Mantis - Resin
Viewing Issue Advanced Details
5536 major always 09-28-13 21:16 10-03-13 10:46
ssmax Linux  
ferg Centos  
normal 5.x,6.x  
closed 4.0.38  
fixed  
none    
none 4.0.38  
0005536: webapp deploy will delete files in symbolic links with expand-preserve-fileset enable
default config in resin.xml

      <web-app-deploy path="webapps"
                      expand-preserve-fileset="WEB-INF/work/**"
                      multiversion-routing="${webapp_multiversion_routing}"
                      path-suffix="${elastic_webapp?resin.id:''}"/>

expand-preserve-fileset="WEB-INF/work/**"
this feature will preserve the files in WEB-INF/work/, but with this feature enable, if there are some symbolic links in the war, resin will delete all files under symbolic links when the war deploy...

if disable this feature, delete the line ' expand-preserve-fileset="WEB-INF/work/**" ' in the config, resin will only delete the files under webapp but leave all files under symbolic links.

i guess this feature first make a file list and filter it, so it found the files under symbolic links and delete it , it is not safe because even 'rm -rf ' will not follow the symbolic links.
put a war in webapps/test.war
it deploy as webapps/test/
ln -s /home/xxx webapps/test/xxx
redeploy test.war
all files in /home/xxx will be deleted, and they are deleted by watchdog , always start with root.

Notes
(0006328)
ferg   
10-03-13 10:46   
server/1hc4