version 1.1.2.3, 2012/09/18 13:24:50
|
version 1.1.2.5, 2012/09/18 15:50:59
|
Line 50 SUCH DAMAGE.
|
Line 50 SUCH DAMAGE.
|
#include <time.h> |
#include <time.h> |
|
|
|
|
|
#define PWD_CRIT_NAME 0 |
|
#define PWD_CRIT_UID 1 |
|
#define PWD_CRIT_GID 2 |
|
|
|
|
struct tagAcctDB { |
struct tagAcctDB { |
unsigned short db_ver; |
unsigned short db_ver; |
unsigned char db_lock; |
unsigned char db_lock; |
Line 166 int cfgReadPasswd(FILE *f, pwd_root_t * __restrict pwd
|
Line 171 int cfgReadPasswd(FILE *f, pwd_root_t * __restrict pwd
|
* return: -1 error or 0 ok |
* return: -1 error or 0 ok |
*/ |
*/ |
int cfgWritePasswd(FILE *f, pwd_root_t * __restrict pwd); |
int cfgWritePasswd(FILE *f, pwd_root_t * __restrict pwd); |
|
/* |
|
* cfgConcatPasswd() - Concat two password roots into one |
|
* |
|
* @pwd = Password root |
|
* @add_pwd = Concated password root will be destroy after merge |
|
* return: -1 error or 0 ok |
|
*/ |
|
int cfgConcatPasswd(pwd_root_t * __restrict pwd, pwd_root_t * __restrict add_pwd); |
|
|
#if 0 |
|
/* |
/* |
* ReadPasswd() Read from file and add new item to user array | * cfg_findPasswdBy() - Find user by criteria position in list |
* @f = file resource | * |
* @ppwd = User array | * @pwd = Password root |
* return: 0 ok; -1 error:: can`t allocate memory | * @criteria = Search criteria [PWD_CRIT_NAME|PWD_CRIT_UID|PWD_CRIT_GID] |
*/ | * @arg1 = Username | UID | GID |
int ReadPasswd(FILE *f, passwd_t * __restrict ppwd); | * return: NULL not found item or error and !=NULL found item |
| */ |
| struct tagUser *cfg_findPasswdBy(pwd_root_t * __restrict pwd, int criteria, ...); |
/* |
/* |
* WritePasswd() Write to file from items in array | * cfg_unsetPasswd() - Unset item from passwords and free resources |
* @f = file resource | * |
* @ppwd = User array | * @pwd = Password root |
* return: 0 ok; -1 error:: can`t write to file | * @criteria = Search criteria [PWD_CRIT_NAME|PWD_CRIT_UID] |
*/ | * @arg1 = Username | UID |
int WritePasswd(FILE *f, passwd_t * __restrict ppwd); | * return: 0 item not found, -1 error or 1 removed item |
| */ |
| int cfg_unsetPasswd(pwd_root_t * __restrict pwd, int criteria, ...); |
|
|
| #if 0 |
/* | |
* pwdCleanStr() Free strings in passwd_t value | |
* @pwd = User object | |
* return: none | |
*/ | |
inline void pwdCleanStr(passwd_t __restrict pwd); | |
/* |
/* |
* pwdFreeValue() Free passwd_t value |
* pwdFreeValue() Free passwd_t value |
* @ppwd = User object |
* @ppwd = User object |