Bugzilla – Bug 1221361
/etc/profile.d/alljava.csh sets JAVA_HOME incorrectly
Last modified: 2024-07-16 12:31:12 UTC
/etc/profile.d/alljava.csh contains the following assignment: setenv JAVA_HOME $ALTERNATIVES_JAVAC_LINK:h:h setenv JAVA_HOME $JAVA_HOME/bin This is clearly incorrect, and makes some Java applications fail to start. Looking at the corresponding Bourne-shell file for comparison, the second of these two assignments is obviously intended to be: setenv JAVA_BINDIR $JAVA_HOME/bin
There is an error in /etc/profile.d/alljava.csh (leap 15.5). The line: set ALTERNATIVES_JAVA_LINK=`realpath /etc/alternatives/java 2> /dev/null` does not work because the c shell does not support std-error redirection. The error causes ALTERNATIVES_JAVA_LINK to be empty and that makes also the variables: JRE_HOME, JAVA_HOME, JDK_HOME and SDK_HOME empty as well. The bug is present in the file: git-47-056fc66c699a8544c7692a03c905fca568f5390b.patch in the leap 15.5 source package. Funny enough, the same file in the leap 15.6 source package is without the bug. Therefore there is no issue on leap 15.6 Tumbleweed instead has incorporated the faulty patch and the file: aaa_base-84.87+git20180409.04c9dae/files/etc/profile.d/alljava.csh in the source tar file: aaa_base-84.87+git20180409.04c9dae.tar.xz contains the same bug as leap 15.5.
I can also confirm the misspelling JAVA_HOME/JAVA_BINDIR Such misspelling is present in Leap 15.5, 15.6 and tumbleweed.
well, the typo with JAVA_HOME is pretty obvious. the question is how to handle stderr output from realpath then, redirecting stderr was added due to bug#1218232 if 15.6 did not have that then this is a build based on an older snapshot of updates and the next milestone will have that same change.
Werner: any good hint how to do the stderr redir for this case we tried so solve bug#1218232 with the lines: -+if ( -l /etc/alternatives/javac ) then -+ set ALTERNATIVES_JAVAC_LINK=`realpath /etc/alternatives/javac` ++if ( -l /etc/alternatives/javac && -e /etc/alternatives/javac ) then ++ set ALTERNATIVES_JAVAC_LINK=`realpath /etc/alternatives/javac 2> /dev/null`
Tom Christiansen's classic document "Csh Programming Considered Harmful" explains that this cannot be done in Csh at all. You need to invoke the Bourne Shell something like: set ALTERNATIVES_JAVAC_LINK=`/bin/sh -c 'realpath /etc/alternatives/javac 2>/dev/null'`
well, since I added the "-e ..." at the same time I'm currently thinking about dropping that stderr redir completely.
https://github.com/openSUSE/aaa_base/pull/147
(In reply to Ruediger Oertel from comment #4) > Werner: any good hint how to do the stderr redir for this case we tried so > solve bug#1218232 with the lines: > > -+if ( -l /etc/alternatives/javac ) then > -+ set ALTERNATIVES_JAVAC_LINK=`realpath /etc/alternatives/javac` > ++if ( -l /etc/alternatives/javac && -e /etc/alternatives/javac ) then > ++ set ALTERNATIVES_JAVAC_LINK=`realpath /etc/alternatives/javac 2> > /dev/null` (t)csh can only rediret stdout or both stdout *and* stderr ... means > or >&
yes, but apparently not just discard stderr which is what I wanted to do when using command output to set a variable.
An update for leap 15.5 come out today, so I went to check what is currently the situation for this bug report: tumbleweed: both typo and stderr redirection fixed Leap 15.5: only stderr redirection fixed, typo still present. Leap 15.6: both typo and stderr redirection present. While the update for leap 15.6 could be on its way, I find suspicious that for leap 15.5 only the stderr redirection was fixed but not the typo. Maybe it was an oversight?
(In reply to Giacomo Comes from comment #12) > An update for leap 15.5 come out today, so I went to check what is currently > the situation for this bug report: > tumbleweed: both typo and stderr redirection fixed > Leap 15.5: only stderr redirection fixed, typo still present. > Leap 15.6: both typo and stderr redirection present. > > While the update for leap 15.6 could be on its way, I find suspicious > that for leap 15.5 only the stderr redirection was fixed but not the typo. > Maybe it was an oversight? Good that you checked. The change was definitely merged into master here: https://github.com/openSUSE/aaa_base/commit/e6815bfc5137556aee3b5752f15ca484c88e513b However, the source of the aaa_base package is the update-sle repo not openSUSE's update-oss. This makes me suspect that fixing the typo failed review by SLE on the basis that enterprise users affected by the issue will have worked around it already. Fixing the problem may break those workarounds. I would love to be proved wrong, but this seems to be a downside of the tight integration of openSUSE with SLE. I'm looking forward to switching to SlowRoll when the time is right....
SUSE-RU-2024:1487-1: An update that has four fixes can now be installed. Category: recommended (moderate) Bug References: 1211721, 1221361, 1221407, 1222547 Maintenance Incident: [SUSE:Maintenance:32998](https://smelt.suse.de/incident/32998/) Sources used: openSUSE Leap Micro 5.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 openSUSE Leap Micro 5.4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 openSUSE Leap 15.5 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise Micro for Rancher 5.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise Micro 5.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise Micro for Rancher 5.4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise Micro 5.4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise Micro 5.5 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 Basesystem Module 15-SP5 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 Development Tools Module 15-SP5 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise High Performance Computing LTSS 15 SP3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise High Performance Computing ESPOS 15 SP4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise High Performance Computing LTSS 15 SP4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise Desktop 15 SP4 LTSS 15-SP4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise Server 15 SP3 LTSS 15-SP3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise Server 15 SP4 LTSS 15-SP4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise Server for SAP Applications 15 SP3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise Server for SAP Applications 15 SP4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Manager Proxy 4.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Manager Retail Branch Server 4.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Manager Server 4.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Enterprise Storage 7.1 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise Micro 5.2 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 SUSE Linux Enterprise Micro for Rancher 5.2 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 openSUSE Leap 15.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.17.3 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
15.6 is on the same package as 15.5 and both still have the JAVA_HOME vs JAVA_BINDIR typo in the csh variant ...
>However, the source of the aaa_base package is the update-sle repo not > openSUSE's update-oss. This makes me suspect that fixing the typo failed review > by SLE on the basis that enterprise users affected by the issue will have > worked around it already. Fixing the problem may break those workarounds. no not really, it was my oversight and I tried to find a solution for csh's inability to just silence stderr and when I did not find a clean solution for that just dropped the redirection and then forgot about the typo from the initial comment ... sorry for that. new maint-request files fixing the typo as well.
SUSE-RU-2024:1876-1: An update that has one fix can now be installed. Category: recommended (moderate) Bug References: 1221361 Maintenance Incident: [SUSE:Maintenance:33622](https://smelt.suse.de/incident/33622/) Sources used: openSUSE Leap 15.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 openSUSE Leap Micro 5.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 openSUSE Leap Micro 5.4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 openSUSE Leap 15.5 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise Micro for Rancher 5.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise Micro 5.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise Micro for Rancher 5.4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise Micro 5.4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise Micro 5.5 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 Basesystem Module 15-SP5 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 Development Tools Module 15-SP5 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise High Performance Computing LTSS 15 SP3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise High Performance Computing ESPOS 15 SP4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise High Performance Computing LTSS 15 SP4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise Desktop 15 SP4 LTSS 15-SP4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise Server 15 SP3 LTSS 15-SP3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise Server 15 SP4 LTSS 15-SP4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise Server for SAP Applications 15 SP3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise Server for SAP Applications 15 SP4 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Manager Proxy 4.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Manager Retail Branch Server 4.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Manager Server 4.3 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Enterprise Storage 7.1 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise Micro 5.2 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 SUSE Linux Enterprise Micro for Rancher 5.2 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Today's update for Leap 15.5 finally fixed the issue. Leap 15.6 thought, is still without fix. And it's final release is just in a couple of weeks.
SUSE-RU-2024:1876-2: An update that has one fix can now be installed. Category: recommended (moderate) Bug References: 1221361 Maintenance Incident: [SUSE:Maintenance:33622](https://smelt.suse.de/incident/33622/) Sources used: openSUSE Leap 15.6 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 Basesystem Module 15-SP6 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 Development Tools Module 15-SP6 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
SUSE-RU-2024:1876-3: An update that has one fix can now be installed. Category: recommended (moderate) Bug References: 1221361 Maintenance Incident: [SUSE:Maintenance:33622](https://smelt.suse.de/incident/33622/) Sources used: SUSE Linux Enterprise Micro 5.5 (src): aaa_base-84.87+git20180409.04c9dae-150300.10.20.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.