JunkBox_Lib 1.10.1
|
LDAP用ライブラリ More...
Go to the source code of this file.
Functions | |
void | read_ldap_config (char *fn, JBXL_LDAP_Host *ldap_host, JBXL_LDAP_Dn *ldap_bind) |
LDAP * | open_ldap_connection (JBXL_LDAP_Host *ldap_host, JBXL_LDAP_Dn *ldap_bind) |
int | simple_check_ldap_passwd (LDAP *ld, char *userid, char *passwd, JBXL_LDAP_Dn *ldap_bind) |
int | check_ldap_passwd (LDAP *ld, JBXL_LDAP_Dn *user, JBXL_LDAP_Dn *ldap_bind) |
void | close_ldap_connection (LDAP *ld, JBXL_LDAP_Host **p_ldap_host, JBXL_LDAP_Dn **p_ldap_bind) |
void | init_LDAP_Host (JBXL_LDAP_Host *host) |
void | init_LDAP_Dn (JBXL_LDAP_Dn *dn) |
void | free_LDAP_Host (JBXL_LDAP_Host *host) |
void | free_LDAP_Dn (JBXL_LDAP_Dn *dn) |
JBXL_LDAP_Host * | new_LDAP_Host (void) |
JBXL_LDAP_Dn * | new_LDAP_Dn (void) |
void | del_LDAP_Host (JBXL_LDAP_Host **p_host) |
void | del_LDAP_Dn (JBXL_LDAP_Dn **p_dn) |
Definition in file ldap_tool.c.
int check_ldap_passwd | ( | LDAP * | ld, |
JBXL_LDAP_Dn * | user, | ||
JBXL_LDAP_Dn * | ldap_bind ) |
int check_ldap_passwd(LDAP* ld, JBXL_LDAP_Dn* user, JBXL_LDAP_Dn* ldap_bind)
LDAP を使用してユーザ認証を行う.
ld | LDAPサーバへのセッションハンドラ |
user | ユーザ情報が格納された JBXL_LDAP_Dn |
ldap_bind | LDAP の BIND情報 |
0 | 正常終了. |
JBXL_LDAP_PASSWD_ERROR | ユーザ認証失敗(ユーザは存在するが,パスワードが一致しない) |
JBXL_LDAP_USER_ERROR | ユーザ認証失敗(ユーザが存在しない) |
JBXL_LDAP_BASE_ERROR | BASE名が不明 |
JBXL_ARGS_ERROR | LDAPサーバへのセッションハンドラが NULL |
Definition at line 261 of file ldap_tool.c.
References _tochar, Buffer::buf, cat_Buffer(), cat_s2Buffer, copy_Buffer(), dup_Buffer(), erase_sBuffer, free_Buffer(), ins_s2Buffer, JBXL_ARGS_ERROR, JBXL_LDAP_BASE_ERROR, JBXL_LDAP_NO_ATTR_ERROR, JBXL_LDAP_NO_ENTRY_ERROR, JBXL_LDAP_NO_USER_ERROR, JBXL_LDAP_NO_VAL_ERROR, JBXL_LDAP_PASSWD_ERROR, JBXL_LDAP_USER_ERROR, and make_Buffer_bystr.
Referenced by simple_check_ldap_passwd().
void close_ldap_connection | ( | LDAP * | ld, |
JBXL_LDAP_Host ** | p_ldap_host, | ||
JBXL_LDAP_Dn ** | p_ldap_bind ) |
void close_ldap_connection(LDAP* ld, JBXL_LDAP_Host** p_ldap_host, JBXL_LDAP_Dn** p_ldap_bind)
LDAPサーバとの接続を閉じる
ld | LDAPサーバへのセッションハンドラ |
p_ldap_host | LDAP の ホスト情報 |
p_ldap_bind | LDAP の BIND情報 |
Definition at line 367 of file ldap_tool.c.
References del_LDAP_Dn(), and del_LDAP_Host().
Referenced by command_PASSWD(), and command_USERID().
void del_LDAP_Dn | ( | JBXL_LDAP_Dn ** | p_dn | ) |
Definition at line 448 of file ldap_tool.c.
References free_LDAP_Dn().
Referenced by close_ldap_connection().
void del_LDAP_Host | ( | JBXL_LDAP_Host ** | p_host | ) |
Definition at line 438 of file ldap_tool.c.
References free_LDAP_Host().
Referenced by close_ldap_connection().
void free_LDAP_Dn | ( | JBXL_LDAP_Dn * | dn | ) |
Definition at line 408 of file ldap_tool.c.
References free_Buffer().
Referenced by del_LDAP_Dn(), and simple_check_ldap_passwd().
void free_LDAP_Host | ( | JBXL_LDAP_Host * | host | ) |
Definition at line 399 of file ldap_tool.c.
References free_Buffer(), and init_LDAP_Host().
Referenced by del_LDAP_Host().
void init_LDAP_Dn | ( | JBXL_LDAP_Dn * | dn | ) |
Definition at line 389 of file ldap_tool.c.
References init_Buffer().
Referenced by new_LDAP_Dn(), and simple_check_ldap_passwd().
void init_LDAP_Host | ( | JBXL_LDAP_Host * | host | ) |
Definition at line 378 of file ldap_tool.c.
References FALSE, and init_Buffer().
Referenced by free_LDAP_Host(), and new_LDAP_Host().
JBXL_LDAP_Dn * new_LDAP_Dn | ( | void | ) |
Definition at line 428 of file ldap_tool.c.
References init_LDAP_Dn().
Referenced by command_PASSWD(), and command_USERID().
JBXL_LDAP_Host * new_LDAP_Host | ( | void | ) |
Definition at line 418 of file ldap_tool.c.
References init_LDAP_Host().
Referenced by command_PASSWD(), and command_USERID().
LDAP * open_ldap_connection | ( | JBXL_LDAP_Host * | ldap_host, |
JBXL_LDAP_Dn * | ldap_bind ) |
LDAP* open_ldap_connection(JBXL_LDAP_Host* ldap_host, JBXL_LDAP_Dn* ldap_bind)
設定ファイルを読み込み後,LDAPサーバに接続する
ldap_host | サーバの情報を格納する JBXL_LDAP_Host へのポインタ |
ldap_bind | 接続情報を格納する JBXL_LDAP_Dn へのポインタ |
Definition at line 129 of file ldap_tool.c.
References Buffer::buf, cat_Buffer(), cat_s2Buffer, DEBUG_MODE, free_Buffer(), freeNull, itostr_ts(), make_Buffer_bystr, PRINT_MESG, and TRUE.
Referenced by command_PASSWD(), and command_USERID().
void read_ldap_config | ( | char * | fn, |
JBXL_LDAP_Host * | ldap_host, | ||
JBXL_LDAP_Dn * | ldap_bind ) |
void read_ldap_config(char* fn, JBXL_LDAP_Host* ldap_host, JBXL_LDAP_Dn* ldap_bind)
ファイル /etc/openldap/ldap.conf, /etc/ldap.conf, /etc/nslcd.conf, fn を順に読んで JBXL_LDAP_Host* ldap_host, JBXL_LDAP_Dn* ldap_bind に情報を格納する.
fn | 設定の格納されたファイル名. |
ldap_host | サーバの情報を格納する JBXL_LDAP_Host へのポインタ |
ldap_bind | 接続情報を格納する JBXL_LDAP_Dn へのポインタ |
Definition at line 37 of file ldap_tool.c.
References add_tList_end(), Buffer::buf, buffer_key_tList(), copy_Buffer(), decomp_url(), del_all_tList(), dup_Buffer(), erase_sBuffer, free_Buffer(), init_Buffer(), read_index_tList_file(), and TRUE.
Referenced by command_PASSWD(), and command_USERID().
int simple_check_ldap_passwd | ( | LDAP * | ld, |
char * | userid, | ||
char * | passwd, | ||
JBXL_LDAP_Dn * | ldap_bind ) |
int simple_check_ldap_passwd(LDAP* ld, char* userid, char* passwd, JBXL_LDAP_Dn* ldap_bind)
LDAPを使用してユーザ認証を行う.
データは JBXL_LDAP_Dn型の変数に格納されてから検証される.
ld | LDAPサーバへのセッションハンドラ |
userid | ユーザID |
passwd | パスワード |
ldap_bind | LDAP の BIND情報 |
0 | 正常終了. |
JBXL_LDAP_PASSWD_ERROR | ユーザ認証失敗(ユーザは存在するが,パスワードが一致しない) |
JBXL_LDAP_USER_ERROR | ユーザ認証失敗(ユーザが存在しない) |
JBXL_LDAP_BASE_ERROR | BASE名が不明 |
JBXL_ARGS_ERROR | LDAPサーバへのセッションハンドラが NULL |
Definition at line 230 of file ldap_tool.c.
References check_ldap_passwd(), dup_Buffer(), free_LDAP_Dn(), init_LDAP_Dn(), and make_Buffer_bystr.
Referenced by command_PASSWD(), and command_USERID().