tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 25822] - tomcat shouldn't write tomcat-users.xml at startup
Date Mon, 05 Jan 2004 16:19:25 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25822>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25822

tomcat shouldn't write tomcat-users.xml at startup





------- Additional Comments From xpoinsard@openpricer.com  2004-01-05 16:19 -------
My first patch doesn't work since it doesn't detect user modification.
My second remove the first patch and implements the following :
- use a temporary file for write instead of conf/tomcat-users.xml.new
- check wether conf/tomcat-users.xml is writable (if it exists)
- rename the temporary files to conf/tomcat-users.xml
It removes the need to write in the directory.

By the way the old code had a very little bug :

        File fileOld = new File(pathnameNew);
        if (!fileOld.isAbsolute()) {
            fileOld =
                new File(System.getProperty("catalina.base"), pathnameOld);
        }

when I expected 

        File fileOld = new File(pathnameOld);
        if (!fileOld.isAbsolute()) {
            fileOld =
                new File(System.getProperty("catalina.base"), pathnameOld);
        }

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message