db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Zaun <Martin.Z...@Sun.COM>
Subject NetworkServerControl shutdown w/ authentication failing?
Date Thu, 21 Jun 2007 04:20:36 GMT

Hi,

there seems to be an issue with 'NetworkServerControl shutdown' and
authentication.  Your comments appreciated.

Here's what I'm doing:

1) Start the network server with these args (all on one line):

$ java -Dderby.connection.requireAuthentication=true
        -Dderby.authentication.provider=BUILTIN
        -Dderby.user.MARTIN=martinspassword
        -Dderby.database.sqlAuthorization=true
        org.apache.derby.drda.NetworkServerControl start

Security manager installed using the Basic server security policy.
Apache Derby Network Server - 10.4.0.0 alpha - (549159M) started and ready to ac
cept connections on port 1527 at 2007-06-20 22:47:08.562 GMT


2) This DOES work: shutdown from a client with authentication:

$ java org.apache.derby.tools.ij
ij version 10.4
ij> connect 'jdbc:derby://localhost:1527/;shutdown=true;user=MARTIN;password=martinspassword';
ERROR XJ015: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ015, SQLERRMC: Derby system shutdown.

    The error code/message is to be expected, I think.


3) What does NOT work and results in a server crash: run shutdown
    from NetworkServerControl with authentication (restarted server):

java -Dderby.connection.requireAuthentication=true
      -Dderby.authentication.provider=BUILTIN
      -Dderby.user.MARTIN=martinspassword
      -Dderby.database.sqlAuthorization=true
      org.apache.derby.drda.NetworkServerControl shutdown

    This command makes the server process terminate after this message:

Derby shutdown warning:
  Connection refused : Invalid authentication.
Apache Derby Network Server - 10.4.0.0 alpha - (549159M) shutdown at 2007-06-20
22:52:59.093 GMT

    Some printlns I put into
        org.apache.derby.jdbc.InternalDriver.connect()
    suggest that the wrong user name 'APP' (instead of 'MARTIN') is being
    used for authentication:

--> InternalDriver.connect()
connect(): finfo = {shutdown=true}
connect(): IdUtil.getUserNameFromURLProps(finfo) = APP


Questions:

- Was I using the authentication properties correctly for 'shutdown'?

- An authentication failure ("Derby shutdown warning") should not result
   in the termination (or crash) of the server process, right?

- For better diagnostics, should the "Invalid authentication" message
   tell the user name being used for authentication?

Thanks,
Martin


Mime
View raw message