Displaying 2 results from an estimated 2 matches for "classpathvmsystemproperties".
2011 Jun 10
2
[LLVMdev] [VMKit] Bug in J3 User.Name detection
Hello List,
I'm currently trying to compile VMKit for the L4 Operating System and
the L4Re Runtime environment for my student project.
While doing so I stumbled upon a bug in the implementation of
lib/J3/Classpath/ClasspathVMSystemProperties.inc
The current version first tries to get the username by checking the
LOGNAME environment variable. If this is NULL it then checks
tmp = getenv("USERNAME");
if (!tmp) tmp = getenv("LOGNAME");
else if (!tmp) tmp = getenv("NAME");
else if (!tmp) tmp = &...
2011 Jun 10
0
[LLVMdev] [VMKit] Bug in J3 User.Name detection
...he environment variable NAME and for
setting a default username of "" fails, because the else paths are only
taken when there inside if condition is false anyways. The elses should
not be there but instead each method should be used until a username is
returned.
lib/J3/Classpath/ClasspathVMSystemProperties.inc
tmp = getenv("USERNAME");
if (!tmp) tmp = getenv("LOGNAME");
else if (!tmp) tmp = getenv("NAME");
else if (!tmp) tmp = "";
The proper way to do this would be
tmp = getenv("USERNAME");
if (!tmp) tmp = getenv("LOGNAME");
if (!...