Permission Analysis Report
Analysis of: org.eclipse.osgi
Detail
Class: org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter (Application)
DoPrivileged location: Line# 377 void check4More( )
Permission: java.util.PropertyPermission "os.name", "read"
Primordial/void java.io.PrintWriter.print( java.lang.String )
CODE
/**
* Displays the more... prompt if the max line count has been reached
* and waits for the operator to hit enter.
*
*/
private void check4More() {
int max = getMaximumLinesToScroll();
if (max > 0) {
if (currentLineCount >= max) {
out.print(ConsoleMsg.CONSOLE_MORE);
out.flush();
con.getInput(); // wait for user entry
resetLineCount(); //Reset the line counter for the 'more' prompt
}
}
}
Tainted variable reference trace:
Permission Requirements:
- permission java.util.PropertyPermission "os.name", "read";
Conclusion:
DoPrivileged location: Line# 378 void check4More( )
Permission: java.util.PropertyPermission "os.name", "read"
Primordial/void java.io.PrintWriter.flush( )
CODE
/**
* Displays the more... prompt if the max line count has been reached
* and waits for the operator to hit enter.
*
*/
private void check4More() {
int max = getMaximumLinesToScroll();
if (max > 0) {
if (currentLineCount >= max) {
out.print(ConsoleMsg.CONSOLE_MORE);
out.flush();
con.getInput(); // wait for user entry
resetLineCount(); //Reset the line counter for the 'more' prompt
}
}
}
Tainted variable reference trace:
Permission Requirements:
- permission java.util.PropertyPermission "os.name", "read";
Conclusion:
DoPrivileged location: Line# 162 java.lang.Object execute( java.lang.String )
Permission: java.util.PropertyPermission "os.name", "read"
Primordial/void java.io.PrintWriter.print( java.lang.String )
CODE
/**
Execute a command line as if it came from the end user.
Searches the list of command providers using introspection until
it finds one that contains a matching method. It searches for a method
with the name "_cmd" where cmd is the command to execute. For example,
for a command of "launch" execute searches for a method called "_launch".
@param cmd The name of the command to execute.
@return The object returned by the method executed.
*/
public Object execute(String cmd) {
if (!firstCommand)
return innerExecute(cmd);
firstCommand = false;
resetLineCount();
Object retval = null;
// handle "more" command here
if (cmd.equalsIgnoreCase("more")) { //$NON-NLS-1$
try {
_more();
} catch (Exception e) {
printStackTrace(e);
}
return retval;
}
// handle "disconnect" command here
if (cmd.equalsIgnoreCase("disconnect") && con.getUseSocketStream()) { //$NON-NLS-1$
try {
_disconnect();
} catch (Exception e) {
printStackTrace(e);
}
return retval;
}
Class[] parameterTypes = new Class[] {CommandInterpreter.class};
Object[] parameters = new Object[] {this};
boolean executed = false;
int size = commandProviders.length;
for (int i = 0; !executed && (i < size); i++) {
try {
Object target = commandProviders[i];
Method method = target.getClass().getMethod("_" + cmd, parameterTypes); //$NON-NLS-1$
retval = method.invoke(target, parameters);
executed = true; // stop after the command has been found
} catch (NoSuchMethodException ite) {
// keep going - maybe another command provider will be able to execute this command
} catch (InvocationTargetException ite) {
executed = true; // don't want to keep trying - we found the method but got an error
printStackTrace(ite.getTargetException());
} catch (Exception ee) {
executed = true; // don't want to keep trying - we got an error we don't understand
printStackTrace(ee);
}
}
// if no command was found to execute, display help for all registered command providers
if (!executed) {
for (int i = 0; i < size; i++) {
try {
CommandProvider commandProvider = (CommandProvider) commandProviders[i];
out.print(commandProvider.getHelp());
out.flush();
} catch (Exception ee) {
printStackTrace(ee);
}
}
// call help for the more command provided by this class
out.print(getHelp());
out.flush();
}
return retval;
}
Tainted variable reference trace:
Permission Requirements:
- permission java.util.PropertyPermission "os.name", "read";
Conclusion:
DoPrivileged location: Line# 163 java.lang.Object execute( java.lang.String )
Permission: java.util.PropertyPermission "os.name", "read"
Primordial/void java.io.PrintWriter.flush( )
CODE
/**
Execute a command line as if it came from the end user.
Searches the list of command providers using introspection until
it finds one that contains a matching method. It searches for a method
with the name "_cmd" where cmd is the command to execute. For example,
for a command of "launch" execute searches for a method called "_launch".
@param cmd The name of the command to execute.
@return The object returned by the method executed.
*/
public Object execute(String cmd) {
if (!firstCommand)
return innerExecute(cmd);
firstCommand = false;
resetLineCount();
Object retval = null;
// handle "more" command here
if (cmd.equalsIgnoreCase("more")) { //$NON-NLS-1$
try {
_more();
} catch (Exception e) {
printStackTrace(e);
}
return retval;
}
// handle "disconnect" command here
if (cmd.equalsIgnoreCase("disconnect") && con.getUseSocketStream()) { //$NON-NLS-1$
try {
_disconnect();
} catch (Exception e) {
printStackTrace(e);
}
return retval;
}
Class[] parameterTypes = new Class[] {CommandInterpreter.class};
Object[] parameters = new Object[] {this};
boolean executed = false;
int size = commandProviders.length;
for (int i = 0; !executed && (i < size); i++) {
try {
Object target = commandProviders[i];
Method method = target.getClass().getMethod("_" + cmd, parameterTypes); //$NON-NLS-1$
retval = method.invoke(target, parameters);
executed = true; // stop after the command has been found
} catch (NoSuchMethodException ite) {
// keep going - maybe another command provider will be able to execute this command
} catch (InvocationTargetException ite) {
executed = true; // don't want to keep trying - we found the method but got an error
printStackTrace(ite.getTargetException());
} catch (Exception ee) {
executed = true; // don't want to keep trying - we got an error we don't understand
printStackTrace(ee);
}
}
// if no command was found to execute, display help for all registered command providers
if (!executed) {
for (int i = 0; i < size; i++) {
try {
CommandProvider commandProvider = (CommandProvider) commandProviders[i];
out.print(commandProvider.getHelp());
out.flush();
} catch (Exception ee) {
printStackTrace(ee);
}
}
// call help for the more command provided by this class
out.print(getHelp());
out.flush();
}
return retval;
}
Tainted variable reference trace:
Permission Requirements:
- permission java.util.PropertyPermission "os.name", "read";
Conclusion:
DoPrivileged location: Line# 169 java.lang.Object execute( java.lang.String )
Permission: java.util.PropertyPermission "os.name", "read"
Primordial/void java.io.PrintWriter.print( java.lang.String )
CODE
/**
Execute a command line as if it came from the end user.
Searches the list of command providers using introspection until
it finds one that contains a matching method. It searches for a method
with the name "_cmd" where cmd is the command to execute. For example,
for a command of "launch" execute searches for a method called "_launch".
@param cmd The name of the command to execute.
@return The object returned by the method executed.
*/
public Object execute(String cmd) {
if (!firstCommand)
return innerExecute(cmd);
firstCommand = false;
resetLineCount();
Object retval = null;
// handle "more" command here
if (cmd.equalsIgnoreCase("more")) { //$NON-NLS-1$
try {
_more();
} catch (Exception e) {
printStackTrace(e);
}
return retval;
}
// handle "disconnect" command here
if (cmd.equalsIgnoreCase("disconnect") && con.getUseSocketStream()) { //$NON-NLS-1$
try {
_disconnect();
} catch (Exception e) {
printStackTrace(e);
}
return retval;
}
Class[] parameterTypes = new Class[] {CommandInterpreter.class};
Object[] parameters = new Object[] {this};
boolean executed = false;
int size = commandProviders.length;
for (int i = 0; !executed && (i < size); i++) {
try {
Object target = commandProviders[i];
Method method = target.getClass().getMethod("_" + cmd, parameterTypes); //$NON-NLS-1$
retval = method.invoke(target, parameters);
executed = true; // stop after the command has been found
} catch (NoSuchMethodException ite) {
// keep going - maybe another command provider will be able to execute this command
} catch (InvocationTargetException ite) {
executed = true; // don't want to keep trying - we found the method but got an error
printStackTrace(ite.getTargetException());
} catch (Exception ee) {
executed = true; // don't want to keep trying - we got an error we don't understand
printStackTrace(ee);
}
}
// if no command was found to execute, display help for all registered command providers
if (!executed) {
for (int i = 0; i < size; i++) {
try {
CommandProvider commandProvider = (CommandProvider) commandProviders[i];
out.print(commandProvider.getHelp());
out.flush();
} catch (Exception ee) {
printStackTrace(ee);
}
}
// call help for the more command provided by this class
out.print(getHelp());
out.flush();
}
return retval;
}
Tainted variable reference trace:
Permission Requirements:
- permission java.util.PropertyPermission "os.name", "read";
Conclusion:
DoPrivileged location: Line# 170 java.lang.Object execute( java.lang.String )
Permission: java.util.PropertyPermission "os.name", "read"
Primordial/void java.io.PrintWriter.flush( )
CODE
/**
Execute a command line as if it came from the end user.
Searches the list of command providers using introspection until
it finds one that contains a matching method. It searches for a method
with the name "_cmd" where cmd is the command to execute. For example,
for a command of "launch" execute searches for a method called "_launch".
@param cmd The name of the command to execute.
@return The object returned by the method executed.
*/
public Object execute(String cmd) {
if (!firstCommand)
return innerExecute(cmd);
firstCommand = false;
resetLineCount();
Object retval = null;
// handle "more" command here
if (cmd.equalsIgnoreCase("more")) { //$NON-NLS-1$
try {
_more();
} catch (Exception e) {
printStackTrace(e);
}
return retval;
}
// handle "disconnect" command here
if (cmd.equalsIgnoreCase("disconnect") && con.getUseSocketStream()) { //$NON-NLS-1$
try {
_disconnect();
} catch (Exception e) {
printStackTrace(e);
}
return retval;
}
Class[] parameterTypes = new Class[] {CommandInterpreter.class};
Object[] parameters = new Object[] {this};
boolean executed = false;
int size = commandProviders.length;
for (int i = 0; !executed && (i < size); i++) {
try {
Object target = commandProviders[i];
Method method = target.getClass().getMethod("_" + cmd, parameterTypes); //$NON-NLS-1$
retval = method.invoke(target, parameters);
executed = true; // stop after the command has been found
} catch (NoSuchMethodException ite) {
// keep going - maybe another command provider will be able to execute this command
} catch (InvocationTargetException ite) {
executed = true; // don't want to keep trying - we found the method but got an error
printStackTrace(ite.getTargetException());
} catch (Exception ee) {
executed = true; // don't want to keep trying - we got an error we don't understand
printStackTrace(ee);
}
}
// if no command was found to execute, display help for all registered command providers
if (!executed) {
for (int i = 0; i < size; i++) {
try {
CommandProvider commandProvider = (CommandProvider) commandProviders[i];
out.print(commandProvider.getHelp());
out.flush();
} catch (Exception ee) {
printStackTrace(ee);
}
}
// call help for the more command provided by this class
out.print(getHelp());
out.flush();
}
return retval;
}
Tainted variable reference trace:
Permission Requirements:
- permission java.util.PropertyPermission "os.name", "read";
Conclusion:
DoPrivileged location: Line# 241 void print( java.lang.Object )
Permission: java.util.PropertyPermission "os.name", "read"
Primordial/void java.io.PrintWriter.print( java.lang.Object )
CODE
/**
* Prints an object to the outputstream
*
* @param o the object to be printed
*/
public void print(Object o) {
synchronized (out) {
check4More();
out.print(o);
out.flush();
}
}
Tainted variable reference trace:
Permission Requirements:
- permission java.util.PropertyPermission "os.name", "read";
Conclusion:
DoPrivileged location: Line# 242 void print( java.lang.Object )
Permission: java.util.PropertyPermission "os.name", "read"
Primordial/void java.io.PrintWriter.flush( )
CODE
/**
* Prints an object to the outputstream
*
* @param o the object to be printed
*/
public void print(Object o) {
synchronized (out) {
check4More();
out.print(o);
out.flush();
}
}
Tainted variable reference trace:
Permission Requirements:
- permission java.util.PropertyPermission "os.name", "read";
Conclusion:
DoPrivileged location: Line# 273 void printStackTrace( java.lang.Throwable )
Permission: java.util.PropertyPermission "os.name", "read"
Primordial/void java.io.PrintWriter.println( java.lang.String )
CODE
/**
* Print a stack trace including nested exceptions.
* @param t The offending exception
*/
public void printStackTrace(Throwable t) {
t.printStackTrace(out);
Method[] methods = t.getClass().getMethods();
int size = methods.length;
Class throwable = Throwable.class;
for (int i = 0; i < size; i++) {
Method method = methods[i];
if (Modifier.isPublic(method.getModifiers()) && method.getName().startsWith("get") && throwable.isAssignableFrom(method.getReturnType()) && (method.getParameterTypes().length == 0)) { //$NON-NLS-1$
try {
Throwable nested = (Throwable) method.invoke(t, null);
if ((nested != null) && (nested != t)) {
out.println(ConsoleMsg.CONSOLE_NESTED_EXCEPTION);
printStackTrace(nested);
}
} catch (IllegalAccessException e) {
} catch (InvocationTargetException e) {
}
}
}
}
Tainted variable reference trace:
Permission Requirements:
- permission java.util.PropertyPermission "os.name", "read";
Conclusion: