db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1300120 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/jdbc/authentication/ engine/org/apache/derby/loc/ shared/org/apache/derby/shared/common/reference/ testing/org/apache/derbyTesting/functionTests/tests/lang/
Date Tue, 13 Mar 2012 13:41:50 GMT
Author: rhillegas
Date: Tue Mar 13 13:41:49 2012
New Revision: 1300120

URL: http://svn.apache.org/viewvc?rev=1300120&view=rev
Log:
DERBY-5647: Add a separate warning message for the expiration of the DBO's password.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/NativeAuthenticationServiceImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NativeAuthenticationServiceTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/NativeAuthenticationServiceImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/NativeAuthenticationServiceImpl.java?rev=1300120&r1=1300119&r2=1300120&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/NativeAuthenticationServiceImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/NativeAuthenticationServiceImpl.java
Tue Mar 13 13:41:49 2012
@@ -553,6 +553,11 @@ public final class NativeAuthenticationS
             
             if ( remainingLifetime <= expirationThreshold )
             {
+                if ( dd.getAuthorizationDatabaseOwner().equals( userName ) )
+                {
+                    throw SQLWarningFactory.newSQLWarning( SQLState.DBO_PASSWORD_EXPIRES_SOON
);
+                }
+                
                 long    daysRemaining = remainingLifetime / Property.MILLISECONDS_IN_DAY;
                 throw SQLWarningFactory.newSQLWarning( SQLState.PASSWORD_EXPIRES_SOON, Long.toString(
daysRemaining ) );
             }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml?rev=1300120&r1=1300119&r2=1300120&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml Tue Mar 13 13:41:49
2012
@@ -217,6 +217,11 @@ Guide.
                 <arg>remainingDays</arg>
             </msg>
 
+            <msg>
+                <name>01J16</name>
+                <text>Your password is stale. To protect the database, you should update
your password soon. Please use the SYSCS_UTIL.SYSCS_MODIFY_PASSWORD  procedure to change your
password.</text>
+            </msg>
+
         </family>
 
         <family>

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?rev=1300120&r1=1300119&r2=1300120&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
(original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
Tue Mar 13 13:41:49 2012
@@ -1745,6 +1745,7 @@ public interface SQLState {
     String NUMBER_OF_ROWS_TOO_LARGE_FOR_INT = "01J13";
 	String SQL_AUTHORIZATION_WITH_NO_AUTHENTICATION = "01J14";
 	String PASSWORD_EXPIRES_SOON = "01J15";
+	String DBO_PASSWORD_EXPIRES_SOON = "01J16";
 		
     String CURSOR_OPERATION_CONFLICT = "01001";
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NativeAuthenticationServiceTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NativeAuthenticationServiceTest.java?rev=1300120&r1=1300119&r2=1300120&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NativeAuthenticationServiceTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NativeAuthenticationServiceTest.java
Tue Mar 13 13:41:49 2012
@@ -126,6 +126,7 @@ public class NativeAuthenticationService
     private static  final   String  NO_COLUMN_PERMISSION = "42502";
     private static  final   String  NO_EXECUTE_PERMISSION = "42504";
     private static  final   String  PASSWORD_EXPIRING = "01J15";
+    private static  final   String  DBO_PASSWORD_EXPIRING = "01J16";
     private static  final   String  BAD_PASSWORD_PROPERTY = "4251J";
     private static  final   String  BAD_PROPERTY_CHANGE = "XCY02";
     private static  final   String  SQL_AUTHORIZATION_NOT_ON = "42Z60";
@@ -1322,6 +1323,8 @@ public class NativeAuthenticationService
 
         reportConnectionAttempt( dbName, user, getPassword( user ), true );
 
+        String  expectedSQLState = DBO.equals( user ) ? DBO_PASSWORD_EXPIRING : PASSWORD_EXPIRING;
+
         conn = openConnection( dbName, user, true, null );
 
         SQLWarning  warning = conn.getWarnings();
@@ -1329,7 +1332,7 @@ public class NativeAuthenticationService
         if ( expiring )
         {
             assertNotNull( tagError( "Should have seen a warning" ), warning );
-            assertSQLState( PASSWORD_EXPIRING, warning );
+            assertSQLState( expectedSQLState, warning );
         }
         else
         {



Mime
View raw message