summaryrefslogtreecommitdiff
path: root/hscript/user.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-18 18:31:19 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-18 18:31:19 -0500
commit799b2fc3939bf4e30ed404a67aa7697ae352f5fe (patch)
tree06ca7e1282503580f557d4b2b41a0897d32aa91c /hscript/user.cc
parente4cd6fffb79807fa1d184bc8d108a91aea8af649 (diff)
downloadhorizon-799b2fc3939bf4e30ed404a67aa7697ae352f5fe.tar.gz
horizon-799b2fc3939bf4e30ed404a67aa7697ae352f5fe.tar.bz2
horizon-799b2fc3939bf4e30ed404a67aa7697ae352f5fe.tar.xz
horizon-799b2fc3939bf4e30ed404a67aa7697ae352f5fe.zip
hscript: Add stub User* classes
Diffstat (limited to 'hscript/user.cc')
-rw-r--r--hscript/user.cc88
1 files changed, 88 insertions, 0 deletions
diff --git a/hscript/user.cc b/hscript/user.cc
index 4d00cb2..92fed4e 100644
--- a/hscript/user.cc
+++ b/hscript/user.cc
@@ -13,6 +13,7 @@
#include <assert.h>
#include <cstring>
#include <fstream>
+#include <set>
#include <sstream>
#include <time.h>
#include "user.hh"
@@ -20,6 +21,23 @@
using namespace Horizon::Keys;
+const static std::set<std::string> system_names = {
+ "root", "bin", "daemon", "adm", "lp", "sync", "shutdown", "halt", "mail",
+ "news", "uucp", "operator", "man", "postmaster", "cron", "ftp", "sshd",
+ "at", "squid", "xfs", "games", "postgres", "cyrus", "vpopmail", "utmp",
+ "catchlog", "alias", "qmaild", "qmailp", "qmailq", "qmailr", "qmails",
+ "qmaill", "ntp", "smmsp", "guest", "nobody"
+};
+
+const static std::set<std::string> system_groups = {
+ "root", "bin", "daemon", "sys", "adm", "tty", "disk", "lp", "mem", "kmem",
+ "wheel", "floppy", "mail", "news", "uucp", "man", "cron", "console",
+ "audio", "cdrom", "dialout", "ftp", "sshd", "input", "at", "tape", "video",
+ "netdev", "readproc", "squid", "xfs", "kvm", "games", "shadow", "postgres",
+ "cdrw", "usb", "vpopmail", "users", "catchlog", "ntp", "nofiles", "qmail",
+ "qmaill", "smmsp", "locate", "abuild", "utmp", "ping", "nogroup", "nobody"
+};
+
Key *RootPassphrase::parseFromData(const std::string &data, int lineno,
int *errors, int *warnings) {
if(data.size() < 5 || data[0] != '$' || (data[1] != '2' && data[1] != '6')
@@ -85,3 +103,73 @@ bool RootPassphrase::execute(ScriptOptions options) const {
return true;
/* LCOV_EXCL_STOP */
}
+
+
+Key *Username::parseFromData(const std::string &data, int lineno, int *errors,
+ int *warnings) {
+ return nullptr;
+}
+
+bool Username::validate(ScriptOptions) const {
+ return false;
+}
+
+bool Username::execute(ScriptOptions) const {
+ return false;
+}
+
+
+Key *UserAlias::parseFromData(const std::string &data, int lineno, int *errors,
+ int *warnings) {
+ return nullptr;
+}
+
+bool UserAlias::validate(ScriptOptions) const {
+ return false;
+}
+
+bool UserAlias::execute(ScriptOptions) const {
+ return false;
+}
+
+
+Key *UserPassphrase::parseFromData(const std::string &data, int lineno,
+ int *errors, int *warnings) {
+ return nullptr;
+}
+
+bool UserPassphrase::validate(ScriptOptions) const {
+ return false;
+}
+
+bool UserPassphrase::execute(ScriptOptions) const {
+ return false;
+}
+
+
+Key *UserIcon::parseFromData(const std::string &data, int lineno, int *errors,
+ int *warnings) {
+ return nullptr;
+}
+
+bool UserIcon::validate(ScriptOptions) const {
+ return false;
+}
+
+bool UserIcon::execute(ScriptOptions) const {
+ return false;
+}
+
+
+Key *UserGroups::parseFromData(const std::string &data, int lineno,
+ int *errors, int *warnings) {
+ return nullptr;
+}
+
+bool UserGroups::validate(ScriptOptions) const {
+ return false;
+}
+
+bool UserGroups::execute(ScriptOptions) const {
+ return false;
+}