[Mono-list] Database/network access permissions
Daniel Freund
Daniel.Freund@zkrd.de
Thu, 12 Aug 2004 11:03:27 +0200 (CEST)
Mono-Monkeys!
I try to access a Firebird 1.5 database with the data provider supplied by
the ibphoenix.com site. The data provider version is 1.6; I use Mono 1.0.1
on SuSE 9.1
When I run my test program (code see below) as root everything goes ok. If
I run the program as normal user, I get the following:
> mono FBTest.exe
Firebird Test
Connection String :
User=SYSDBA;Password=masterkey;Database=/opt/firebird/db/TEST.FDB;Server=127.0.0.1
--> Unable to complete network request to host "127.0.0.1".
in <0x000d0> FirebirdSql.Data.Firebird.FbDbConnection:Connect ()
in <0x0004f> (wrapper remoting-invoke-with-check)
FirebirdSql.Data.Firebird.FbDbConnection:Connect ()
in <0x001e2> FirebirdSql.Data.Firebird.FbConnection:Open ()
in <0x0004f> (wrapper remoting-invoke-with-check)
FirebirdSql.Data.Firebird.FbConnection:Open ()
in <0x00126> FBTest.MainClass:Main (string[])
Any ideas? Is this a permission or configuration problem?
BTW, I can access my Firebird as user using the isql command line.
Initially I came over this problem with an ASP.NET page. If I run
XSP/mod_mono_server as root everything is fine. If Apache starts
mod_mono_server itself (as wwwrun), I also get the "unable to complete
network request ..." error.
Here comes the example code:
using System;
using System.Data;
using FirebirdSql.Data.Firebird;
namespace FBTest
{
class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("Firebird Test");
string database = @"/opt/firebird/db/TEST.FDB";
string server = "127.0.0.1";
string user = "SYSDBA";
string pass = "masterkey";
string connString =
String.Format(@"User={0};Password={1};Database={2};Server={3}",
user, pass, database, server);
Console.WriteLine("Connection String : " + connString);
try {
FbConnection conn = new FbConnection(connString);
conn.Open();
FbCommand command = new FbCommand("select * from navigation",
conn);
FbDataReader reader = command.ExecuteReader();
while(reader.Read()) {
Console.WriteLine("Table: " + reader.GetValue(0));
}
reader.Close();
conn.Close();
} catch (Exception e) {
Console.WriteLine("--> " + e.Message);
Console.WriteLine(e.StackTrace);
}
}
}
}
regards,
/daniel