View Issue Details

IDProjectCategoryView StatusLast Update
0016256mantisbtdb mssqlpublic2015-03-15 19:58
ReporterJepolis Assigned Todregad  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformIIS / MSSQLOSWindows 
Product Version1.2.15 
Target Version1.3.0-beta.2Fixed in Version1.3.0-beta.2 
Summary0016256: Windows authentication failing with mssqlnative
Description

If you're trying to use windows authentication when the db_type is set to mssqlnative the installation will fail due to always passing a username/password, i.e. it's interpreted that the user is trying to use SQL authentication.

The driver is by default trying to use windows authentication (http://msdn.microsoft.com/en-US/library/cc296205(v=sql.90).aspx), but Mantis' pre-installation check requires a username/password.

Additional Information

The db connect functions includes username and password arguments (../admin/install.php and ../core/database_api.php). One way to force the use of Windows authentication is to pass empty strings for those arguments (at least it worked for me). At least I have not been able to find any connection string that instructs the installation to use IWA. According to the official documentation such an option isn't available either for mssqlnative (http://msdn.microsoft.com/en-US/library/ff628167(v=sql.90).aspx).

I've attached the patches, but this is NOT a sustainable solution. It will however fix the issue if somebody faces the same situation as I.

My setup was:
IIS 7.5
SQL Server 2008
Mantis 1.2.15
PHP 5.3.27
MSSQL driver for PHP (2.0)

TagsNo tags attached.
Attached Files
database_api.php.patch (958 bytes)   
91c91
< 			$t_result = $g_db->PConnect( $p_hostname, $p_username, $p_password, $p_database_name );
---
> 			$t_result = $g_db->PConnect( $p_hostname, '', '', $p_database_name );
93c93
< 			$t_result = $g_db->Connect( $p_hostname, $p_username, $p_password, $p_database_name );
---
> 			$t_result = $g_db->Connect( $p_hostname, '', '', $p_database_name );
937c937
< 		db_connect( config_get_global( 'dsn', false ), $g_hostname, $g_db_username, $g_db_password, $g_database_name, config_get_global( 'db_schema' ) );
---
> 		db_connect( config_get_global( 'dsn', false ), $g_hostname, '', '', $g_database_name, config_get_global( 'db_schema' ) );
939c939
< 		db_connect( config_get_global( 'dsn', false ), $g_hostname, $g_db_username, $g_db_password, $g_database_name, config_get_global( 'db_schema' ), true );
---
> 		db_connect( config_get_global( 'dsn', false ), $g_hostname, '', '', $g_database_name, config_get_global( 'db_schema' ), true );
database_api.php.patch (958 bytes)   
install.php.patch (880 bytes)   
303c303
< 	$t_result = @$g_db->Connect( $f_hostname, $f_admin_username, $f_admin_password );
---
> 	$t_result = @$g_db->Connect( $f_hostname );
308c308
< 		$t_result = @$g_db->Connect( $f_hostname, $f_admin_username, $f_admin_password, $f_database_name );
---
> 		$t_result = @$g_db->Connect( $f_hostname, $f_database_name );
335c335
< 		$t_result = @$g_db->Connect( $f_hostname, $f_db_username, $f_db_password, $f_database_name );
---
> 		$t_result = @$g_db->Connect( $f_hostname, $f_database_name );
619c619
< 		$t_result = @$g_db->Connect( $f_hostname, $f_db_username, $f_db_password, $f_database_name );
---
> 		$t_result = @$g_db->Connect( $f_hostname, $f_database_name );
883c883
< 	$t_result = @$g_db->Connect( $f_hostname, $f_db_username, $f_db_password, $f_database_name );
---
> 	$t_result = @$g_db->Connect( $f_hostname, '', '', $f_database_name );
install.php.patch (880 bytes)   

Activities

grangeway

grangeway

2014-02-17 13:26

reporter   ~0039435

Marking as Suspended

MSSQL support is currently known broken. We are going to be replacing the DB Layer in Mantis to fix this properly after the next release.

I'd strongly advise using MYSQL for now.

The new DB layer already contains the appropriate fixes for MS SQL Support.

grangeway

grangeway

2014-03-27 19:12

reporter   ~0039764

MSSQL support is currently known broken. We are going to be replacing the DB Layer in Mantis to fix this properly after the next release.

I'd strongly advise using MYSQL for now.

The new DB layer already contains the appropriate fixes for MS SQL Support.

grangeway

grangeway

2014-05-16 15:00

reporter   ~0040322

MantisBT currently supports Mysql and has support for other database engines.

The support for other databases is known to be problematic.

Having implemented the current database layer into Mantis 10 years ago, I'm currently working on replacing the current layer.

If you are interested in using Mantis with non-mysql databases - for example, Oracle, PGSQL or MSSQL, and would be willing to help out testing the new database layer, please drop me an email at paul@mantisforge.org

In the meantime, I'd advise running Mantis with Mysql Only to avoid issues.

Thanks
Paul

dregad

dregad

2015-03-14 14:02

developer   ~0049229

Despite the fact that I am not actually able to test whether the problem is truly resolved since I don't have access to a MSSQL server setup, I'm marking this issue as fixed in 1.3.x on the grounds that the recent updates in ADOdb (which contain many improvements in the MSSQL driver) are likely to address it.

Should the problem persist (using a nightly build or a version > 1.3.0-beta.1), feel free to reopen this issue or to create a new one.