Commit | Line | Data |
---|---|---|
0a654ec0 TJ |
1 | /*************************************************************************** |
2 | * Copyright (C) 2008 by Intra2net AG - Thomas Jarosch * | |
3 | * thomas.jarosch@intra2net.com * | |
4 | * http://www.intra2net.com * | |
5 | ***************************************************************************/ | |
6 | #ifndef DAEMONFUNC_H | |
7 | #define DAEMONFUNC_H | |
8 | ||
9 | #include <sys/types.h> | |
10 | #include <string> | |
11 | ||
12 | /// Collection of functions for daemons | |
13 | class daemon | |
14 | { | |
15 | public: | |
16 | static void daemonize(); | |
17 | ||
18 | static uid_t lookup_uid(const std::string &username); | |
19 | static gid_t lookup_gid(const std::string &group); | |
20 | ||
21 | static void drop_root_priviledges(const std::string &username, | |
22 | const std::string &group); | |
23 | }; | |
24 | ||
25 | #endif |