1/*
2 * Copyright (c) 2011, 2012, ETH Zurich.
3 * All rights reserved.
4 *
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
8 */
9
10#ifndef POSIXCOMPAT_USERDB_H
11#define POSIXCOMPAT_USERDB_H
12
13#include <pwd.h>
14#include <barrelfish/cpu_arch.h> // for CURRENT_CPU_TYPE
15#include <barrelfish_kpi/cpu.h>
16
17#if CURRENT_CPU_TYPE == CPU_X86_64
18# define CURRENT_CPU_TYPE_STR "x86_64"
19#elif CURRENT_CPU_TYPE == CPU_X86_32
20# define CURRENT_CPU_TYPE_STR "x86_32"
21#elif CURRENT_CPU_TYPE == CPU_ARM7
22# define CURRENT_CPU_TYPE_STR "armv7"
23#else
24# error "unknown CURRENT_CPU_TYPE"
25#endif
26
27#define DEFAULT_SHELL "/" CURRENT_CPU_TYPE_STR "/sbin/fish"
28
29/*
30 * Static user database akin /etc/passwd.
31 */
32
33static struct passwd userdb[] = {
34    { // dummyuser
35        .pw_name = "user",
36        .pw_passwd = "abcd",
37        .pw_uid = 1000,
38        .pw_gid = 100,
39        .pw_gecos = "John Doe",
40        .pw_dir = "/",
41        .pw_shell = DEFAULT_SHELL,
42    },
43    { // non-privileged user for sshd
44        .pw_name = "sshd",
45        .pw_passwd = "*",
46        .pw_uid = 1001,
47        .pw_gid = 1001,
48        .pw_gecos = "sshd user",
49        .pw_dir = "/",
50        .pw_shell = DEFAULT_SHELL,
51    }
52};
53
54#endif // POSIXCOMPAT_USERDB_H
55