String name = (String) p.nextElement();
String value = props.getProperty(name);
String option = "-D" + name + "=" + value;
try {
checkPermission(perms,
new ExecOptionPermission(option));
} catch (AccessControlException e) {
if (value.equals("")) {
checkPermission(perms,
new ExecOptionPermission("-D" + name));
} else {
throw e;
}
}
}
}
/*
* Check group class name (allow nothing but the default),
* code location (must be null), and data (must be null).
*/
String groupClassName = desc.getClassName();
if ((groupClassName != null &&
!groupClassName.equals(
ActivationGroupImpl.class.getName())) ||
(desc.getLocation() != null) ||
(desc.getData() != null))
{
throw new AccessControlException(
"access denied (custom group implementation not allowed)");
}
/*
* If group descriptor has a command environment, check
* command and options.
*/
ActivationGroupDesc.CommandEnvironment cmdenv;
cmdenv = desc.getCommandEnvironment();
if (cmdenv != null) {
String path = cmdenv.getCommandPath();
if (path != null) {
checkPermission(perms, new ExecPermission(path));
}
String[] options = cmdenv.getCommandOptions();
if (options != null) {
for (String option : options) {
checkPermission(perms,
new ExecOptionPermission(option));
}
}
}
}