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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to