1 // Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
5 #ifndef COMMON_UTILS_USER_UTIL_H_
6 #define COMMON_UTILS_USER_UTIL_H_
8 #include <boost/filesystem/path.hpp>
9 #include <boost/optional.hpp>
11 #include <sys/types.h>
17 namespace bf = boost::filesystem;
19 namespace common_installer {
21 typedef std::vector<std::tuple<uid_t, gid_t, bf::path>> UserList;
23 UserList GetUserList();
24 boost::optional<bool> IsAdminUser(uid_t uid);
25 boost::optional<gid_t> GetGidByUid(uid_t uid);
26 std::string GetGroupNameByGid(gid_t gid);
27 std::string GetUsernameByUid(uid_t user);
28 boost::optional<uid_t> GetUidByUserName(const char* username);
29 boost::optional<gid_t> GetGidByGroupName(const char* groupname);
32 } // namespace common_installer
34 #endif // COMMON_UTILS_USER_UTIL_H_