Community
Participate
Working Groups
In multithread environments, a default directory in launching unix shell is set to a home directory of daemon userId. The default directory must be set to a home directory of the client user Id who connects the daemon. Looking at the CommandMinerThread, the condition statement is not correct. And the property name must be "client.username" instead of "user.name". For example, in UniversalProcessMiner, the following is used: _dataStore.getClient().getProperty("client.username")
Created attachment 210097 [details] Patch for setting a default directory in launching shell correctly
Legal Message: I, {Noriaki Takatsu}, declare that I developed the attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. I am authorized by my employer to make this contribution under the EPL.
please backport to 30x & 32x
Created attachment 210114 [details] updated patch to include copyright statement
I've committed the change to the HEAD stream and created bug 369808 and bug 369809 for backporting.
both backports (30x 32x) fail on z/OS su userid -c sh /u/userid> FSUM5015 su: No password entered. > Shell Completed (exit code = 2) You may not use the su command on z/OS, it is a restricted command requiring special permits or the password of the target userid.
(In reply to comment #6) > both backports (30x 32x) fail on z/OS > > su userid -c sh > > /u/userid> > FSUM5015 su: No password entered. > > Shell Completed (exit code = 2) > > > You may not use the su command on z/OS, it is a restricted command requiring > special permits or the password of the target userid. The change to use "su" came about as a result of bug 287305. I don't work in z environments so I can only rely of z/OS people for expertise here. Back in 2009 Violaine requested that particular change to the command miner.
Dave, I finally got around to this one again. Violaine's request is for single server on Linux, so we can safely bypass this when using z/OS. I also noticed that the patch Noriaki provided earlier is the wrong version (he made two according to our internal documentation, but this bug only received the first one). I'm pasting in the whole thing here. There is a bug in default directory for z/OS Unix Shell Launch. The CommandMinerThread has the following code: Client client = _dataStore.getClient(); if (client != null && !theOS.equals("z/OS")){ String clientActualUserId = client.getProperty("user.name"); String clientUserId = client.getUserid(); userHome = client.getProperty("user.home"); if (clientUserId != null && !clientActualUserId.equals(clientUserId)){ suCommand = "su " + clientUserId + " -c "; } } else { userHome = System.getProperty("user.home"); } In zOS, we have to refer to dataStore.getClient() instead of System.property and so the code must be: Client client = _dataStore.getClient(); if (client != null && theOS.equals("z/OS")){ <== ! must be removed String clientActualUserId = client.getProperty("user.name"); String clientUserId = client.getUserid(); userHome = client.getProperty("user.home"); if (clientUserId != null && !clientActualUserId.equals(clientUserId)){ suCommand = "su " + clientUserId + " -c "; } } else { userHome = System.getProperty("user.home"); } The corrected code still has a problem in issuing su command. The su command requests RDz to enter its password. This fails and the shell is close. In multi-server environments, a client ownership is already established in the CommandMinerThread. Therefore, the su command is not needed in this case and the code should be Client client = _dataStore.getClient(); if (client != null && theOS.equals("z/OS")){ <== ! must be removed String clientActualUserId = client.getProperty("user.name"); String clientUserId = client.getUserid(); userHome = client.getProperty("user.home"); } else { userHome = System.getProperty("user.home"); } You'll probably have to change it around a bit to keep the su for Violaine when using Linux.
Now I can understand from where the su requirement comes. The su command is needed in Linux server. Now, I attached additional patch to support both zOS environment and Linux environment.
Created attachment 211466 [details] patch to support both zOS and Linux environments
Comment on attachment 211466 [details] patch to support both zOS and Linux environments >### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.services.dstore >Index: miners/org/eclipse/rse/internal/dstore/universal/miners/command/CommandMinerThread.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/internal/dstore/universal/miners/command/CommandMinerThread.java,v >retrieving revision 1.46 >diff -u -r1.46 CommandMinerThread.java >--- miners/org/eclipse/rse/internal/dstore/universal/miners/command/CommandMinerThread.java 26 Jan 2012 14:27:00 -0000 1.46 >+++ miners/org/eclipse/rse/internal/dstore/universal/miners/command/CommandMinerThread.java 23 Feb 2012 03:10:47 -0000 >@@ -191,12 +191,12 @@ > String userHome = null; > Client client = _dataStore.getClient(); > >- if (client != null && theOS.equals("z/OS")){ //$NON-NLS-1$ >+ if (client != null){ //$NON-NLS-1$ > String clientActualUserId = client.getProperty("client.username");//$NON-NLS-1$ > String clientUserId = client.getUserid(); > > userHome = client.getProperty("user.home");//$NON-NLS-1$ >- if (clientUserId != null && !clientActualUserId.equals(clientUserId)){ >+ if (!theOS.equals("z/OS") && clientUserId != null && !clientActualUserId.equals(clientUserId)){ > suCommand = "su " + clientUserId + " -c "; //$NON-NLS-1$ //$NON-NLS-2$ > } > }
I've applied the updated patch to the HEAD stream.