powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Firebird, InterBase [игнор отключен] [закрыт для гостей] / Firebird & C++ & Linux
5 сообщений из 5, страница 1 из 1
Firebird & C++ & Linux
    #32259453
AGX
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
AGX
Гость
Hi,

Iam trying to connect from Linux to my firebird database. That's easier than i expected, but there is one problem. When i try to specify username (using DPB)
There is code:

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
    long sweep_interval;
    long l;
    ...   // All other variables

    p = dpb;
    sweep_interval =  16384 ;
    *p++ = '\1';
    *p++ = isc_dpb_sweep_interval;
    *p++ = '\4';
    l = isc_vax_integer((char ISC_FAR *) &sweep_interval,  4 );
    d = (char *) &l;
    *p++ = *d++;
    *p++ = *d++;
    *p++ = *d++;
    *p = *d;
    dpb_len =  7 ;
    p = dpb;
    isc_expand_dpb(&p,(short ISC_FAR *) &dpb_len, 
		   isc_dpb_user_name, uname, 
		   isc_dpb_password, passw, 
		   isc_dpb_sql_role_name, rolename, NULL
	);
    if (isc_attach_database(status,  0 , dbname, &db, dpb_len, dpb)) {
	err( "can't connect to database" );
    }


Everything is allright - connection is succeseful, but Firebird ignores my specified username and password - i can enter anything that i want in place of username and password and connection is succeseful. But when i try to make some query (like SELECT or UPDATE) i receive error code:
no permission for read/select access to TABLE TT_CURR_RATE

What should i do to get it working properly.
P.S. When i log in my Linux box as root then all querys are succeseful. This problem is when i log in as normal user (not root).
...
Рейтинг: 0 / 0
Firebird & C++ & Linux
    #32259513
Gold
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Root is equivalent to SYSDBA. You should check your user's rights on objects which you use.
You may change database and database objects owher. For this you shuld connect as SYSDBA or root and execute two commands:
UPDATE RDB$RELATIONS SET RDB$OWNER_NAME='YOUR_USER_NAME';
UPDATE RDB$PROCEDURES SET RDB$OWNER_NAME='YOUR_USER_NAME';
Ufter that you should backup database under SYSDBA or root an restore it under your user.
...
Рейтинг: 0 / 0
Firebird & C++ & Linux
    #32259613
AGX
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
AGX
Гость
When i connect from windows client (4 example IB Expert) I can do select and update querys. I am using ROLES to grant specific access for specific user groups. All i want is to make little tool which connects to database on the same Linux machine where the database is. I have tried to use uid and gid fields in isc4.gdb file for Linux authentification - but they seems have no sense at all!
I dont want to use my root account for this tool everytime - because that is not secure!
...
Рейтинг: 0 / 0
Firebird & C++ & Linux
    #32259671
Gold
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
It is a low-level programming and only few people use it. You can look into sources of Delphi components and try to make connection similary or you can use SYSDBA instead of root, or, as I sad earlier, you can create a special user (owner of database and objects) and work with him.
...
Рейтинг: 0 / 0
Firebird & C++ & Linux
    #32259726
AGX
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
AGX
Гость
Thanks.

I'll try some other ways how to hack this thing!
...
Рейтинг: 0 / 0
5 сообщений из 5, страница 1 из 1
Форумы / Firebird, InterBase [игнор отключен] [закрыт для гостей] / Firebird & C++ & Linux
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]