accounts.h (1064B)
1 /* see LICENSE file for copyright and license details */ 2 #ifndef ARUU_ACCOUNTS_H 3 #define ARUU_ACCOUNTS_H 4 5 #include <sys/types.h> 6 7 /* the account files (passwd, shadow, group) changed for a person: each 8 * file is written whole, keeping its mode and owner. 0, or -1 with errno 9 * set (EEXIST, ENOENT, EINVAL, ENOSYS where the system keeps accounts 10 * some other way). passwords go through pwdb_update (passwd.h) */ 11 12 /* a name a person may have: a lowercase letter or _, then lowercase 13 * letters, digits, _ and -, at most 32 */ 14 int acct_valid_name(const char *name); 15 /* a person: the next free id from 1000, a group of their own of the same 16 * id, home and shell as given, hash as their password (crypt's) */ 17 int acct_add(const char *name, const char *home, const char *shell, const char *hash, uid_t *uid); 18 /* the person gone from the three files, and from every group they were in. 19 * their home stays */ 20 int acct_remove(const char *name); 21 /* name put in group (in != 0) or taken out of it */ 22 int acct_member(const char *group, const char *name, int in); 23 24 #endif