Issue Details (XML | Word | Printable)

Key: XWIKI-239
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vincent Massol
Reporter: Srini Pulugurtha
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XWiki Core

DBCPConnectionProvider should not fail when database username and password are not supplied in hibernate configuration.

Created: 23/Mar/06 16:48   Updated: 25/Dec/06 17:50
Component/s: Storage
Affects Version/s: 1.0 B1
Fix Version/s: 1.0 B2

Environment: XWiki + Oracle (Externally authenticated)

Date of First Response: 22/Dec/06 14:34
Resolution Date: 25/Dec/06 17:50


 Description  « Hide
In our company, Oracle JDBC connections are externally authenticated (OS authenticated). So, username and password are not passed in when using JDBC drivers. Infact, when you pass them in, the connection fails.

DBCPConnectionProvider inserts username and password into a hashatbale without checking for null. So, it will get a null pointer exception. Once I added the checks, it worked fine.

I understand that, external authentication is specific to companies paranoid of security. So, its a very low priority issue.

////////////////////////////////////////////////////
public void configure(Properties props) throws HibernateException {
try {
log.debug("Configure DBCPConnectionProvider");

// DBCP properties used to create the BasicDataSource
Properties dbcpProperties = new Properties();

// DriverClass & url
String jdbcDriverClass = props.getProperty(Environment.DRIVER);
String jdbcUrl = props.getProperty(Environment.URL);
dbcpProperties.put("driverClassName", jdbcDriverClass);
dbcpProperties.put("url", jdbcUrl);
//////////////////////////////////////
// Username / password
String username = props.getProperty(Environment.USER);
String password = props.getProperty(Environment.PASS);
if(username != null) // Srini - added a null check - does not exist in xwiki source
dbcpProperties.put("username", username);
if(password != null) // Srini - added a null check
dbcpProperties.put("password", password);



 All   Comments   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
Ludovic Dubost added a comment - 22/Dec/06 14:34
These tasks need to be verified and put in the planning if these are bugs

Vincent Massol added a comment - 25/Dec/06 17:50
Committed. Srini please let us know if it's not working for you. Thanks.