This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
USER=${USER:-`logname 2>/dev/null`}
USER=${USER:-${USERNAME}}
TMPBASE=${TMPBASE:-/var/tmp}
TMPDIRBASE=${TMPBASE}/dlight_${USER}
TMPDIRBASE=${TMPBASE}/dlight_${USER}/${NB_KEY}
mkdir -p "${TMPDIRBASE}"
echo BITNESS=${BITNESS}
package org.netbeans.modules.nativeexecution.support.hostinfo.impl;
import java.io.File;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
this.name = name;
}
/**
* @return unique key of the current NB instance, introduced to fix bug #176526
*/
/*package-local*/ static String getNBKey() {
// use NB userdir to prevent local collisions
int hashCode = System.getProperty("netbeans.user", "").hashCode();
try {
// use host name to prevent remote collisions
InetAddress localhost = InetAddress.getLocalHost();
hashCode = 3 * hashCode + 5 * localhost.getHostName().hashCode();
} catch (UnknownHostException ex) {
return Integer.toHexString(hashCode);
pb.environment().put("TMPBASE", tmpDirBase); // NOI18N
pb.environment().put("PATH", pb.environment().get("PATH") + File.pathSeparator + "/bin:/usr/bin"); // NOI18N
pb.environment().put("NB_KEY", HostInfoFactory.getNBKey());
Process hostinfoProcess = pb.start();
hiOutputStream = echannel.getOutputStream();
hiInputStream = echannel.getInputStream();
// echannel.setEnv() didn't work, so writing this directly
hiOutputStream.write(("NB_KEY=" + HostInfoFactory.getNBKey() + '\n').getBytes()); // NOI18N
hiOutputStream.flush();
BufferedReader scriptReader = new BufferedReader(new FileReader(hostinfoScript));
String scriptLine = scriptReader.readLine();
_tmpDirFile = new File(ioTmpDir, "dlight_" + env.get("USERNAME")); // NOI18N
_tmpDirFile = new File(_tmpDirFile, HostInfoFactory.getNBKey());
// create the directory if absent (IZ#174327)
_tmpDirFile.mkdirs();