#include <dirent.h>#include <errno.h>#include <fcntl.h>#include <inttypes.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 "../../bin/afppasswd/afppasswd_migrate.c"Data Structures | |
| struct | test_context |
Macros | |
| #define | getpwnam test_getpwnam |
| #define | write test_write |
| #define | fsync test_sync |
| #define | mkdirat test_mkdirat |
| #define | unlinkat test_unlinkat |
| #define | SALT_HEX_LEN 32 |
| #define | VERIFIER_HEX_LEN 384 |
Functions | |
| static struct passwd * | test_getpwnam (const char *name) |
| static ssize_t | test_write (int fd, const void *data, size_t length) |
| static int | test_sync (int fd) |
| static int | test_mkdirat (int fd, const char *path, mode_t mode) |
| static int | test_unlinkat (int fd, const char *path, int flags) |
| const char * | tmpdir (void) |
| Find a suitable temporary directory for Netatalk. | |
| static void | report (int passed, const char *name) |
| static char * | make_record (const char *username, char salt, char verifier) |
| static int | write_file (const char *path, const char *data) |
| static char * | read_file (const char *path) |
| static int | make_case (char directory[MAXPATHLEN+1], char path[MAXPATHLEN+1], const char *source) |
| static void | remove_case (const char *directory) |
| static int | count_case_entries (const char *directory) |
| static int | run_migration (const char *path, struct test_context *context) |
| static int | source_is_unchanged (const char *path, const char *expected) |
| static void | test_success (mode_t mode, const char *description) |
| static void | test_final_record_without_newline (void) |
| static void | test_rejected_source (const char *name, const char *source, int collide_uids) |
| static void | test_disabled_ownership (void) |
| static void | test_write_failure (void) |
| static void | test_sync_failure (int sync_call, const char *name) |
| static void | test_rollback_cleanup_failure (int sync_call, int fail_unlink, const char *name) |
| static void | test_backup_collision_and_repeat (void) |
| static void | test_unsafe_metadata (void) |
| static void | test_hardlinked_source (void) |
| static void | test_staging_collision (void) |
| static void | test_partial_destination (void) |
| int | main (void) |
Variables | |
| static struct test_context * | active_context |
| static int | tests_run |
| static int | tests_failed |
| #define fsync test_sync |
| #define getpwnam test_getpwnam |
| #define mkdirat test_mkdirat |
| #define SALT_HEX_LEN 32 |
| #define unlinkat test_unlinkat |
| #define VERIFIER_HEX_LEN 384 |
| #define write test_write |
|
static |
| int main | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
extern |
Find a suitable temporary directory for Netatalk.
Creates a subdirectory for current gid if it doesn't exist. The result should be copied immediately as it may be overwritten by a subsequent call.
|
static |
|
static |
|
static |
|
static |