|
|
|
[
Permlink
| « Hide
]
Jay Shaughnessy - 17/Jun/08 10:25 AM
r10064 protected against circularity when discovering scripts (due to symbolic links defined on the agent). Needs to be tested on *NIX environment and also need to look for other areas this may occur.
Other tree-walking: * org.rhq.core.pluginapi.util.FileUtils.purge() may also need symlink protection. In this case we probably don't want to follow symlinks, just delete them. * org.rhq.enterprise.server.plugin.content.ContentSourcePluginClassLoader may need it for its (near duplicate) purge method. * ServerInformation in the installer also recursively walks dir trees but I think this is safe since we're under control of the file structure being worked on. I don't want to make changes here given the proximity of the 2.0.1 release and the fact that this code is not tied to any reported issues. It should be addressed soon after release. A tech note from Ian re: detecting symlinks, which is not fully supported in Java:
Note, if you did want to determine if something was a symlink, you could also always use SIGAR: Sigar sigar = new Sigar(); FileInfo fileInfo sigar.getFileInfo(file.getPath()); if (fileInfo.getType() == FileInfo.TYPE_LNK) { // file is a symlink } test steps:
There are lots of circularity scenarios you could create, this is just one, but one should suffice. Install a JBoss release on a *NIX system 0) cd $HOME 1) mkdir myscripts 2) cd myscripts 2) test2.sh ) ln --symbolic jbossinstalldir/bin bad-link 3) cd bad-link 4) mkdir scripts 5) cd scripts 6) create scripts/test1.sh 7) ln --symbolic $HOME/myscripts myscripts 8) ls -lLR This should have a circularity defined. ) start jboss ) start an agent on this machine, ensuring the server has a jbossas plugin with the fix. ) discover and import the jboss server ) ensure the bin scripts, test1.sh and test2.sh are all inventoried scripts. verified : bin scripts, test1.sh and test2.sh are all inventoried scripts
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||