Diff for /libaitcfg/inc/aitpwd.h between versions 1.1.2.7 and 1.8

version 1.1.2.7, 2012/09/19 11:53:52 version 1.8, 2025/01/31 00:03:15
Line 12  terms: Line 12  terms:
 All of the documentation and software included in the ELWIX and AITNET  All of the documentation and software included in the ELWIX and AITNET
 Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>  Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>
   
Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012Copyright 2004 - 2024
         by Michael Pounov <misho@elwix.org>.  All rights reserved.          by Michael Pounov <misho@elwix.org>.  All rights reserved.
   
 Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
Line 49  SUCH DAMAGE. Line 49  SUCH DAMAGE.
   
 #include <time.h>  #include <time.h>
 #include <sys/types.h>  #include <sys/types.h>
#include <aitio.h>#include <elwix.h>
   
   
 #define PWD_CRIT_NAME   0  #define PWD_CRIT_NAME   0
Line 69  struct tagAcctDB { Line 69  struct tagAcctDB {
         uint64_t        db_since;          uint64_t        db_since;
   
         int             db_h;           /* optional */          int             db_h;           /* optional */
} __packed;} __attribute__((packed));
   
 /* Search callback function, compare to match argument to record match ...   /* Search callback function, compare to match argument to record match ... 
  *  (return: -1 error, 0 not match or 1 match)   *  (return: -1 error, 0 not match or 1 match)
Line 118  typedef enum { ALL = -1,  Line 118  typedef enum { ALL = -1, 
         Shell           Shell 
 } passwd_attr_t;  } passwd_attr_t;
   
   #ifdef __cplusplus
   extern "C" {
   #endif
   
 /*  /*
  * cfgInitPasswd() - Init password root   * cfgInitPasswd() - Init password root
  *   *
 * @pwd = Password root * return: NULL error or !=NULL allocated password root
 * return: -1 error or 0 ok 
  */   */
int cfgInitPasswd(pwd_root_t * __restrict pwd);pwd_root_t *cfgInitPasswd();
 /*  /*
    * cfgEndPasswd() - Free resources & password root
    *
    * @ppwd = Password root
    * return: none
    */
   void cfgEndPasswd(pwd_root_t **ppwd);
   /*
  * cfgLoadPasswd() - Load passwords from file   * cfgLoadPasswd() - Load passwords from file
  *   *
  * @pwdName = Passwords filename   * @pwdName = Passwords filename
Line 188  int cfgConcatPasswd(pwd_root_t * __restrict pwd, pwd_r Line 197  int cfgConcatPasswd(pwd_root_t * __restrict pwd, pwd_r
  * @pwd = Password root   * @pwd = Password root
  * @csName = Username   * @csName = Username
  * @csPass = Password   * @csPass = Password
 * return: -1 error, 1 deny or 0 allow * return: =NULL deny or !=NULL allow
  */   */
int cfgAuthPasswd(pwd_root_t * __restrict pwd, const char *csName, const char *csPass);const struct tagUser *cfgAuthPasswd(pwd_root_t * __restrict pwd, 
                 const char *csName, const char *csPass);
   
 /*  /*
  * cfg_findPasswdBy() - Find user by criteria position in list   * cfg_findPasswdBy() - Find user by criteria position in list
Line 200  int cfgAuthPasswd(pwd_root_t * __restrict pwd, const c Line 210  int cfgAuthPasswd(pwd_root_t * __restrict pwd, const c
  * @arg1 = Username | UID | GID   * @arg1 = Username | UID | GID
  * return: NULL not found item or error and !=NULL found item   * return: NULL not found item or error and !=NULL found item
  */   */
struct tagUser *cfg_findPasswdBy(pwd_root_t * __restrict pwd, int criteria, ...);const struct tagUser *cfg_findPasswdBy(pwd_root_t * __restrict pwd, int criteria, ...);
 /*  /*
  * cfg_unsetPasswd() - Unset item from passwords and free resources   * cfg_unsetPasswd() - Unset item from passwords and free resources
  *   *
Line 214  int cfg_unsetPasswd(pwd_root_t * __restrict pwd, int c Line 224  int cfg_unsetPasswd(pwd_root_t * __restrict pwd, int c
  * cfg_setPasswd() - Set item in password or adding new item if not exists   * cfg_setPasswd() - Set item in password or adding new item if not exists
  *   *
  * @cfg = Password root   * @cfg = Password root
    * @fields = Following parameters are continuous to certain field
  * @csName = Username   * @csName = Username
 * @csPass = Password * @arg1 = Password
 * @uid = UID * @arg2 = UID
 * @gid = GID * @arg3 = GID
 * @Class = Login class * @arg4 = Login class
 * @change = Chage date * @arg5 = Chage date
 * @expire = Expire date * @arg6 = Expire date
 * @csRealm = Realm * @arg7 = Realm
 * @csHome = Home dir * @arg8 = Home dir
 * @csShell = Shell * @arg9 = Shell
  * return: 0 nothing changed, -1 error, 1 found and updated item or 2 added new item   * return: 0 nothing changed, -1 error, 1 found and updated item or 2 added new item
  */   */
int cfg_setPasswd(pwd_root_t * __restrict pwd, const char *csName, const char *csPass, int cfg_setPasswd(pwd_root_t * __restrict pwd, passwd_attr_t fields, const char *csName, ...);
                unsigned int uid, unsigned int gid, const char *csClass,  
                unsigned int change, unsigned int expire, const char *csRealm,  
                const char *csHome, const char *csShell); 
 /*  /*
  * cfg_getPasswd() - Get item from passwords and return structure from it   * cfg_getPasswd() - Get item from passwords and return structure from it
  *   *
Line 238  int cfg_setPasswd(pwd_root_t * __restrict pwd, const c Line 246  int cfg_setPasswd(pwd_root_t * __restrict pwd, const c
  * @arg1 = Username | UID   * @arg1 = Username | UID
  * return: NULL item not found, !=NULL structure found   * return: NULL item not found, !=NULL structure found
  */   */
inline const struct tagUser *cfg_getPasswd(pwd_root_t * __restrict pwd, int criteria, ...);const struct tagUser *cfg_getPasswd(pwd_root_t * __restrict pwd, int criteria, ...);
   
   #ifdef __cplusplus
   }
   #endif
   
 #endif  #endif

Removed from v.1.1.2.7  
changed lines
  Added in v.1.8


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>