diff options
author | Tim Pepper <timothy.c.pepper@linux.intel.com> | 2012-09-11 14:33:18 -0700 |
---|---|---|
committer | Tim Pepper <timothy.c.pepper@linux.intel.com> | 2012-09-11 14:33:18 -0700 |
commit | bc56d27c7f24309456202cb69beec87d308c0fd2 (patch) | |
tree | a05eddeabdcae9651070be0e6a69d74a5480fbfb | |
parent | 874fa2815a95293585be6a216c3734719be04007 (diff) | |
download | corewatcher-bc56d27c7f24309456202cb69beec87d308c0fd2.tar.gz corewatcher-bc56d27c7f24309456202cb69beec87d308c0fd2.tar.bz2 corewatcher-bc56d27c7f24309456202cb69beec87d308c0fd2.zip |
Require allow-submit=yes and allow-pass-on=yes
Refuse to run if allow-submit=yes and allow-pass-on=yes are not set in the
config file. These will be set by a prompt at first boot.
Signed-off-by: Tim Pepper <timothy.c.pepper@linux.intel.com>
-rw-r--r-- | src/configfile.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/configfile.c b/src/configfile.c index 1003a1c..d1634a2 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -64,6 +64,30 @@ void read_config_file(char *filename) line_end = line + line_len; + c = strstr(line, "allow-submit"); + if (c) { + c+=13; + if (c < line_end) { + if (!strstr(c, "yes")) { + printf("Error: allow-submit!=yes in config file.\n"); + printf("Corewatcher will not run.\n"); + exit(-1); + } + } + } + + c = strstr(line, "allow-pass-on"); + if (c) { + c+=14; + if (c < line_end) { + if (!strstr(c, "yes")) { + printf("Error: allow-pass-on!=yes in config file.\n"); + printf("Corewatcher will not run.\n"); + exit(-1); + } + } + } + c = strstr(line, "submit-url"); if (c && url_count <= MAX_URLS) { c += 11; |