You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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))) ||
#endif
(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.");
}
CheckIsolationLevel\(\);
\}
\}
---
The text was updated successfully, but these errors were encountered:
Submitted by: Daniel Martin (sanosdole)
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))) ||
#endif
(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.");
}
---
The text was updated successfully, but these errors were encountered: