-
Notifications
You must be signed in to change notification settings - Fork 2
/
user.h
36 lines (30 loc) · 815 Bytes
/
user.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) 2010-2023 David Caldwell <david@porkrind.org>
// Licenced under the GPL 3.0 or any later version. See LICENSE file for details.
#ifndef __USER_H__
#define __USER_H__
#include "passwd.h"
#include <string>
#include <map>
#include <vector>
#include <sys/types.h>
using namespace std;
class user {
public:
string name;
uid_t uid;
gid_t gid;
string homedir;
string logdir;
string daemondir;
map<uid_t,bool> can_run_as_uid;
vector<user*> manages;
user(string name, string daemondir, string logdir);
void create_dirs();
string config_path();
string log_dir();
vector<string> config_files();
private:
void init(const pwent &pw, string daemondir, string logdir);
string replace_dir_patterns(string pattern);
};
#endif /* __USER_H__ */