mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 04:55:22 +02:00
[254785] [dstore] RSE Server assumes home directory on target machine
This commit is contained in:
parent
2b0e88e140
commit
def631d22f
2 changed files with 29 additions and 7 deletions
|
@ -8,6 +8,7 @@
|
||||||
#
|
#
|
||||||
# Contributors:
|
# Contributors:
|
||||||
# IBM Corporation - initial API and implementation
|
# IBM Corporation - initial API and implementation
|
||||||
|
# David McKnight (IBM) - [254785] [dstore] RSE Server assumes home directory on target machine
|
||||||
#*******************************************************************************
|
#*******************************************************************************
|
||||||
|
|
||||||
use Shell;
|
use Shell;
|
||||||
|
@ -39,7 +40,7 @@ else
|
||||||
chomp($pwdIN);
|
chomp($pwdIN);
|
||||||
|
|
||||||
|
|
||||||
@passwdStruct = getpwnam($userIN);
|
@passwdStruct = getpwnam($userIN);
|
||||||
|
|
||||||
if (@passwdStruct == 0)
|
if (@passwdStruct == 0)
|
||||||
{
|
{
|
||||||
|
@ -49,6 +50,9 @@ else
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$passwd=$passwdStruct[1];
|
$passwd=$passwdStruct[1];
|
||||||
|
$dir=$passwdStruct[7]; // get the user's home dir
|
||||||
|
#$passwd = $pass;
|
||||||
|
|
||||||
$encryptedPWD = crypt($pwdIN, $passwd);
|
$encryptedPWD = crypt($pwdIN, $passwd);
|
||||||
$classpath=$ENV{CLASSPATH};
|
$classpath=$ENV{CLASSPATH};
|
||||||
$suOptions="-p";
|
$suOptions="-p";
|
||||||
|
@ -65,8 +69,15 @@ else
|
||||||
$suOptions="-";
|
$suOptions="-";
|
||||||
}
|
}
|
||||||
|
|
||||||
system("su $suOptions $userIN -c '$javaExe -cp $classpath -DA_PLUGIN_PATH=$pathIN -DDSTORE_SPIRIT_ON=true org.eclipse.dstore.core.server.Server $portIN $timeoutIN $ticketIN'");
|
# check for the existence of a home directory
|
||||||
1;
|
$homeDir=$dir;
|
||||||
|
if (!(-e $homeDir))
|
||||||
|
{
|
||||||
|
$homeDir="/tmp/" . $userIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
system("su $suOptions $userIN -c '$javaExe -Duser.home=$homeDir -cp $classpath -DA_PLUGIN_PATH=$pathIN -DDSTORE_SPIRIT_ON=true org.eclipse.dstore.core.server.Server $portIN $timeoutIN $ticketIN'");
|
||||||
|
1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#
|
#
|
||||||
# Contributors:
|
# Contributors:
|
||||||
# IBM Corporation - initial API and implementation
|
# IBM Corporation - initial API and implementation
|
||||||
|
# David McKnight (IBM) - [254785] [dstore] RSE Server assumes home directory on target machine
|
||||||
#*******************************************************************************
|
#*******************************************************************************
|
||||||
|
|
||||||
use Shell;
|
use Shell;
|
||||||
|
@ -25,7 +26,7 @@ else
|
||||||
$timeoutIN = $ARGV[3];
|
$timeoutIN = $ARGV[3];
|
||||||
$ticketIN = $ARGV[4];
|
$ticketIN = $ARGV[4];
|
||||||
|
|
||||||
if (defined($ARGV[5]))
|
if (defined($ARGV[5]))
|
||||||
{
|
{
|
||||||
$javaHome = $ARGV[5];
|
$javaHome = $ARGV[5];
|
||||||
$javaExe = "$javaHome/bin/java";
|
$javaExe = "$javaHome/bin/java";
|
||||||
|
@ -34,12 +35,12 @@ else
|
||||||
{
|
{
|
||||||
$javaExe = "java"
|
$javaExe = "java"
|
||||||
}
|
}
|
||||||
|
|
||||||
$pwdIN = <STDIN>;
|
$pwdIN = <STDIN>;
|
||||||
chomp($pwdIN);
|
chomp($pwdIN);
|
||||||
|
|
||||||
|
|
||||||
@passwdStruct = getpwnam($userIN);
|
@passwdStruct = getpwnam($userIN);
|
||||||
|
|
||||||
if (@passwdStruct == 0)
|
if (@passwdStruct == 0)
|
||||||
{
|
{
|
||||||
|
@ -49,6 +50,9 @@ else
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$passwd=$passwdStruct[1];
|
$passwd=$passwdStruct[1];
|
||||||
|
$dir=$passwdStruct[7]; // get the user's home dir
|
||||||
|
#$passwd = $pass;
|
||||||
|
|
||||||
$encryptedPWD = crypt($pwdIN, $passwd);
|
$encryptedPWD = crypt($pwdIN, $passwd);
|
||||||
$classpath=$ENV{CLASSPATH};
|
$classpath=$ENV{CLASSPATH};
|
||||||
$suOptions="-p";
|
$suOptions="-p";
|
||||||
|
@ -65,7 +69,14 @@ else
|
||||||
$suOptions="-";
|
$suOptions="-";
|
||||||
}
|
}
|
||||||
|
|
||||||
system("su $suOptions $userIN -c '$javaExe -cp $classpath -DA_PLUGIN_PATH=$pathIN -DDSTORE_SPIRIT_ON=true org.eclipse.dstore.core.server.Server $portIN $timeoutIN $ticketIN'");
|
# check for the existence of a home directory
|
||||||
|
$homeDir=$dir;
|
||||||
|
if (!(-e $homeDir))
|
||||||
|
{
|
||||||
|
$homeDir="/tmp/" . $userIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
system("su $suOptions $userIN -c '$javaExe -Duser.home=$homeDir -cp $classpath -DA_PLUGIN_PATH=$pathIN -DDSTORE_SPIRIT_ON=true org.eclipse.dstore.core.server.Server $portIN $timeoutIN $ticketIN'");
|
||||||
1;
|
1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue