Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 97138 invoked from network); 2 Aug 2005 09:56:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Aug 2005 09:56:31 -0000 Received: (qmail 20728 invoked by uid 500); 2 Aug 2005 09:56:23 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 20681 invoked by uid 500); 2 Aug 2005 09:56:23 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 20668 invoked by uid 99); 2 Aug 2005 09:56:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2005 02:56:23 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [195.227.118.3] (HELO mailserver.kippdata.de) (195.227.118.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2005 02:56:13 -0700 Received: from [195.227.30.175] (pfarr.kippdata.de [195.227.30.175]) by mailserver.kippdata.de (8.12.10/8.12.10) with ESMTP id j729uJgP023004 for ; Tue, 2 Aug 2005 11:56:19 +0200 (MEST) Message-ID: <42EF4387.3030900@kippdata.de> Date: Tue, 02 Aug 2005 11:57:27 +0200 From: Rainer Jung User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Developers List Subject: Writing MemoryUserDatabase on Startup References: <20050802023251.8258CE0@ajax.apache.org> In-Reply-To: <20050802023251.8258CE0@ajax.apache.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I wonder, why /org/apache/catalina/users/MemoryUserDatabaseFactory.java saves the MemoryUserDatabase directly after opening it: public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception { ... // Return the configured database instance database.open(); database.save(); return (database); } That means, the runtime user of tomcat needs write permissions on the directory, the file is in (see the implementation of MemoryUserDatabase.save()). Ogf course in case one likes to administer the user database the save function is necessary. But there are two cases where one would prefer to have tomcat not trying to save the database during startup: 1) Running tomcat from CD 2) Having a very secure setup of tomcat, where all the configs are write disabled. The call to database.save() is in the code since the very first version in TC 4, but I can't really see, why it is necessary. Another possibility would be to catch the Exception thrown when there is no write permission and to simply log a warning. Also: there is a save() done in close(). I don't know, where the close is called from, but it looks like nowhere in catalina code (eventually in admin). Any comments? Thanks! Rainer --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org