[fpc-pascal] Connecting to Firebird using FPC/Lazarus over a LAN with user creation privilege

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Sat Mar 9 14:08:58 CET 2013


I don't know whether anybody can help me with this one, but I'm working 
on something where I need a program to be able to create login-capable 
database users on-the-fly. I was hoping to be able to use either 
PostgreSQL or Firebird as the backend, but while Postgres is working 
fine Firebird is proving to be sufficiently difficult that I might just 
drop it.

Using isql-fb on Debian x86, I've created a database borg_ng with, among 
others, a user borg_um to which I've granted admin and rdb$admin rights. 
If I use isql-fb running either as root or as firebird with the 
rdb$admin role I can create a new user and verify it using gsec:

# isql-fb -user borg_um -password password -role 'rdb$admin'
Use CONNECT or CREATE DATABASE to specify a database
SQL> connect borg_ng;
Database:  borg_ng, User: borg_um, Role: RDB$ADMIN
SQL> create user test__4 password 'password';
..
GSEC> di
      user name                    uid   gid admin     full name
..
TEST__4                             0     0

Unfortunately I'm having a lot of difficulty doing this under program 
control, with the obvious difference being that FPC/Lazarus is 
connecting via a socket.

Has anybody had anything like this working in the past?

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list