[fpc-pascal] Re: Connecting to Firebird using FPC/Lazarus over a LAN with user creation privilege
reinierolislagers at gmail.com
reinierolislagers at gmail.com
Sat Mar 9 14:25:35 CET 2013
On 9-3-2013 14:08, Mark Morgan Lloyd wrote:
> 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?
>
Have you tried the Firebird admin module that Ludo Brands wrote? It
connects using the FB service interface and allows user creation.
Firebird also offers CREATE USER SQL AFAIR (since FB 2.5, perhaps earlier)
More information about the fpc-pascal
mailing list