Issue Details (XML | Word | Printable)

Key: DNET-744
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jiri Cincura
Reporter: Daniel Martin
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
.NET Data provider

Unable to connect bundled embedded database on macOS

Created: 23/Mar/17 11:21 AM   Updated: 14/Jul/17 12:35 PM
Component/s: ADO.NET Provider
Affects Version/s:
Fix Version/s:

Environment: macOS Sierra, Firebird 2.5.6 embedded, Mono 4.8

 Description  « Hide
When bundling the Firebird database with a mono application, one must not provide a user and a password in the connection string as otherwise the libfbembed.dylib (Firebird binary) attempts to attach to the systems security2.fdb.
The FbConnectionString class forces the client to provide a user and password if LINUX is defined, as trusted auth does no exist on non-windows platforms.

This was locally fixed by checking the FbConnectionString.ServerType property in FbConnectionString.Validate and FbConnectionString.FallIntoTrustedAuth.
See the provided methods below for details.

I'm not sure whether this is the correct solution or if it creates any side effects.

internal bool FallIntoTrustedAuth
// on non-Win the UserID/Password is checked in Validate method
get { return ServerType != FbServerType.Embedded && string.IsNullOrEmpty(UserID) && string.IsNullOrEmpty(Password); } // Embedded does not require a password
public void Validate()
if (!ContextConnection)
if (
#if (LINUX) // on Linux Trusted Auth isn't available
(ServerType != FbServerType.Embedded && (string.IsNullOrEmpty(this.UserID) || // Embedded does not require a password
string.IsNullOrEmpty(this.Password))) ||
(string.IsNullOrEmpty(Database) && !_isServiceConnectionString) ||
(string.IsNullOrEmpty(DataSource) && ServerType != FbServerType.Embedded) ||
(string.IsNullOrEmpty(Charset)) ||
(Port == 0) ||
(!Enum.IsDefined(typeof(FbServerType), ServerType)) ||
(MinPoolSize > MaxPoolSize)
throw new ArgumentException("An invalid connection string argument has been supplied or a required connection string argument has not been supplied.");
if (Dialect < 1 || Dialect > 3)
throw new ArgumentException("Incorrect database dialect it should be 1, 2, or 3.");
if (PacketSize < 512 || PacketSize > 32767)
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "'Packet Size' value of {0} is not valid.{1}The value should be an integer >= 512 and <= 32767.", PacketSize, Environment.NewLine));
if (DbCachePages < 0)
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "'Db Cache Pages' value of {0} is not valid.{1}The value should be an integer >= 0.", DbCachePages, Environment.NewLine));
if (Pooling && NoDatabaseTriggers)
throw new ArgumentException("Cannot use Pooling and NoDBTriggers together.");


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.