AFP user password utility. More...
#include <arpa/inet.h>#include <ctype.h>#include <errno.h>#include <fcntl.h>#include <pwd.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/param.h>#include <sys/stat.h>#include <sys/types.h>#include <unistd.h>#include <gcrypt.h>#include <atalk/compat.h>#include <crack.h>Macros | |
| #define | DES_KEY_SZ 8 |
| #define | OPT_ISROOT (1 << 0) |
| #define | OPT_CREATE (1 << 1) |
| #define | OPT_FORCE (1 << 2) |
| #define | OPT_ADDUSER (1 << 3) |
| #define | OPT_NOCRACK (1 << 4) |
| #define | PASSWD_ILLEGAL '*' |
| #define | FORMAT ":****************:****************:********\n" |
| #define | FORMAT_LEN 44 |
| #define | OPTIONS "cafnu:p:w:" |
| #define | UID_START 100 |
| #define | HEXPASSWDLEN 16 |
| #define | PASSWDLEN 8 |
| #define | unhex(x) |
Functions | |
| static void | convert_passwd (char *buf, char *newpwd, const int keyfd) |
| static int | update_passwd (const char *path, const char *name, int flags, const char *pass) |
| static int | create_file (const char *path, uid_t minuid) |
| int | main (int argc, char **argv) |
Variables | |
| static char | buf [MAXPATHLEN+1] |
AFP user password utility.
format of the password file:
***'s are illegal. they're just place holders for hex values. hex values that represent actual numbers are in network byte order.
last login date is currently a 4-byte number representing seconds since 1970 (UTC). there's enough space to extend it to 8 bytes.
the last two fields aren't currently used by the randnum uams.
| #define DES_KEY_SZ 8 |
| #define FORMAT ":****************:****************:********\n" |
| #define FORMAT_LEN 44 |
| #define HEXPASSWDLEN 16 |
| #define OPT_ADDUSER (1 << 3) |
| #define OPT_CREATE (1 << 1) |
| #define OPT_FORCE (1 << 2) |
| #define OPT_ISROOT (1 << 0) |
| #define OPT_NOCRACK (1 << 4) |
| #define OPTIONS "cafnu:p:w:" |
| #define PASSWD_ILLEGAL '*' |
| #define PASSWDLEN 8 |
| #define UID_START 100 |
| #define unhex | ( | x | ) |
|
static |
|
static |
| int main | ( | int | argc, |
| char ** | argv ) |
|
static |
|
static |