netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
afppasswd.c File Reference
#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>

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]

Macro Definition Documentation

◆ DES_KEY_SZ

#define DES_KEY_SZ   8

◆ FORMAT

#define FORMAT   ":****************:****************:********\n"

◆ FORMAT_LEN

#define FORMAT_LEN   44

◆ HEXPASSWDLEN

#define HEXPASSWDLEN   16

◆ OPT_ADDUSER

#define OPT_ADDUSER   (1 << 3)

◆ OPT_CREATE

#define OPT_CREATE   (1 << 1)

◆ OPT_FORCE

#define OPT_FORCE   (1 << 2)

◆ OPT_ISROOT

#define OPT_ISROOT   (1 << 0)

◆ OPT_NOCRACK

#define OPT_NOCRACK   (1 << 4)

◆ OPTIONS

#define OPTIONS   "cafnu:p:w:"

◆ PASSWD_ILLEGAL

#define PASSWD_ILLEGAL   '*'

◆ PASSWDLEN

#define PASSWDLEN   8

◆ UID_START

#define UID_START   100

◆ unhex

#define unhex ( x)
Value:
(isdigit(x) ? (x) - '0' : toupper(x) + 10 - 'A')

Function Documentation

◆ convert_passwd()

void convert_passwd ( char * buf,
char * newpwd,
const int keyfd )
static

◆ create_file()

int create_file ( const char * path,
uid_t minuid )
static

◆ main()

int main ( int argc ,
char ** argv )

◆ update_passwd()

int update_passwd ( const char * path,
const char * name,
int flags,
const char * pass )
static

Variable Documentation

◆ buf

char buf[MAXPATHLEN+1]
static