View Issue Details

IDProjectCategoryView StatusLast Update
0016256mantisbtdb mssqlpublic2015-03-15 19:58
ReporterJepolisAssigned Todregad 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformIIS / MSSQLOSWindowsOS Version
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.

Activities

Jepolis

Jepolis

2013-08-08 05:32

reporter  

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 );
Jepolis

Jepolis

2013-08-08 05:32

reporter  

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)
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.

Issue History

Date Modified Username Field Change
2013-08-08 05:31 Jepolis New Issue
2013-08-08 05:32 Jepolis File Added: database_api.php.patch
2013-08-08 05:32 Jepolis File Added: install.php.patch
2013-08-14 08:36 MishaMart Issue cloned: 0016295
2013-08-16 04:38 hero2289 Tag Attached: closed
2013-08-16 06:33 atrol Tag Detached: closed
2014-02-17 13:26 grangeway Note Added: 0039435
2014-03-27 19:12 grangeway Note Added: 0039764
2014-03-27 19:12 grangeway Status new => resolved
2014-03-27 19:12 grangeway Resolution open => suspended
2014-03-27 19:12 grangeway Assigned To => grangeway
2014-03-28 04:18 atrol Status resolved => assigned
2014-04-12 19:33 grangeway Target Version => 1.3.0-beta.1
2014-05-16 15:00 grangeway Note Added: 0040322
2014-05-23 15:08 grangeway Project mantisbt => @24@
2014-11-07 14:35 atrol Assigned To grangeway =>
2014-11-07 14:35 atrol Status assigned => new
2014-11-07 14:35 atrol Project @24@ => mantisbt
2014-12-08 02:10 atrol Target Version 1.3.0-beta.1 => 1.3.0-beta.2
2015-03-14 14:02 dregad Note Added: 0049229
2015-03-14 14:02 dregad Status new => resolved
2015-03-14 14:02 dregad Fixed in Version => 1.3.0-beta.2
2015-03-14 14:02 dregad Resolution suspended => fixed
2015-03-14 14:02 dregad Assigned To => dregad
2015-03-15 19:58 dregad Status resolved => closed