セキュリティ情報に関連するデータ
セキュリティ設定のクエリ へ戻る
isc_info_svc_get_users
結果項目は、複数のデータのセットを返します。 複数のユーザーがレポートされる場合は、結果バッファは複数のクラスタを格納します。 バッファ内容の末尾は、クラスタの isc_info_flag_end
値によって示されます。 次の表に、ユーザー情報に関するクラスタ識別子を示します。
引数 | 目的 | 戻り値の長さ | 戻り値 |
---|---|---|---|
|
InterBase セキュリティ データベース(デフォルトは |
2 バイト + 文字列 |
文字列 |
|
ユーザー ID に関連付けられているファースト ネーム |
2 バイト + 文字列 |
文字列 |
|
ユーザー ID に関連付けられているミドル ネーム |
2 バイト + 文字列 |
文字列 |
|
ユーザー ID に関連付けられているラスト ネーム |
2 バイト + 文字列 |
文字列 |
|
ユーザーを登録するための |
4 バイト |
unsigned long |
|
ユーザーを登録するための |
4 バイト |
unsigned long |
|
引数の終わりを |
— |
— |
サービス API を使ったクエリ: サーバー上で設定されているユーザー
. . . case isc_info_svc_get_users: { ISC_USHORT len, loop; ISC_ULONG id; char buffer[50], *buf = buffer; loop = (ISC_USHORT) isc_portable_integer (p, sizeof (ISC_USHORT)); p += sizeof (ISC_USHORT); while (*p != isc_info_end) { switch (*p++) { case isc_spb_sec_username: len = (ISC_USHORT) isc_portable_integer(p, sizeof(ISC_USHORT)); p += sizeof (ISC_USHORT); strncpy (buf, p, len); p += len; buffer[len] = 0; printf ("Username: %s\n", buffer); loop -= (len + sizeof(ISC_USHORT)+1); break; case isc_spb_sec_firstname: len = (ISC_USHORT) isc_portable_integer(p, sizeof(ISC_USHORT)); p += sizeof (ISC_USHORT); strncpy (buf, p, len); p += len; buffer[len] = 0; printf ("Firstname: %s\n", buffer); loop -= (len + sizeof(ISC_USHORT)+1); break; case isc_spb_sec_middlename: len = (ISC_USHORT) isc_portable_integer(p, sizeof(ISC_USHORT)); p += sizeof (ISC_USHORT); strncpy (buf, p, len); p += len; buffer[len] = 0; printf ("Middlename: %s\n", buffer); loop -= (len + sizeof(ISC_USHORT)+1); break; case isc_spb_sec_lastname: len = (ISC_USHORT) isc_portable_integer(p, sizeof(ISC_USHORT)); p += sizeof (ISC_USHORT); strncpy (buf, p, len); p += len; buffer[len] = 0; printf ("Lastname: %s\n", buffer); loop -= (len + sizeof(ISC_USHORT)+1); break; case isc_spb_sec_groupid: id = isc_portable_integer (p, sizeof (ISC_ULONG)); p += sizeof (ISC_ULONG); printf ("Group ID: %d\n", id); loop -= (len + sizeof(ISC_ULONG)+1); break; case isc_spb_sec_userid: id = isc_portable_integer (p, sizeof (ISC_ULONG)); p += sizeof (ISC_ULONG); printf ("User ID: %d\n", id); loop -= (len + sizeof(ISC_ULONG)+1); break; default: *x = *p; break; } /* end switch */ } /* end while */ break; } . . .
isc_info_svc_svr_db_info
結果項目は、複数のデータのセットを返します。 複数のアクティブ データベースがレポートされる場合は、結果バッファは複数のクラスタを格納します。 バッファ内容の末尾は、クラスタの isc_info_flag_end
値によって示されます。 次の表に、データベース接続情報に関するクラスタ識別子を示します。
引数 | 目的 | 戻り値の長さ | 戻り値 |
---|---|---|---|
|
サーバー上で現在使用されている接続の数 |
4 バイト |
unsigned long |
|
サーバー上で現在使用されているデータベースの数 |
4 バイト |
unsigned long |
|
サーバー上で現在使用されているデータベースの名前。この項目は、使用されているデータベースごとに発生する |
2 バイト + 文字列 |
文字列 |
|
引数の終わりを |
— |
— |
サービス API を使ったクエリ: データベース接続
. . . case isc_info_svc_svr_db_info: { printf ("Database information:\n"); do { switch (*p++) { case isc_spb_dbname: { /* Database names in use */ path_length = (unsigned short) isc_portable_integer(p, sizeof(unsigned short)); p += sizeof (unsigned short); buffer = (char*) malloc (path_length); strncpy (buffer, p, path_length); buffer [path_length] = '\0'; printf ("Database in use: %s\n", buffer); p += path_length; break; } case isc_spb_num_att: { /* Num Attachments */ unsigned long nAttachments; p+= sizeof (unsigned short); nAttachments = (unsigned long) isc_portable_integer(p, sizeof (unsigned long)); printf ("\tNumber of attachments: %d\n", nAttachments); p += sizeof(unsigned long); break; } case isc_spb_num_db: { /* Num databases */ unsigned long nDatabases; p+= sizeof (unsigned short); nDatabases = (unsigned long) isc_portable_integer(p, sizeof(unsigned long)); printf ("\tNumber of databases: %d\n", nDatabases); p += sizeof(unsigned long); break; } } } while (*p != isc_info_flag_end); break; } . . .
サービス API を使ったクエリ: 例の終わり
. . . } } while (*p); isc_service_detach(status, &service_handle); }