aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunk@stsci.edu>2012-08-21 13:32:06 -0400
committerJoseph Hunkeler <jhunk@stsci.edu>2012-08-21 13:32:06 -0400
commitaf3defbdd7628371381ffcd29cda82d653fd2929 (patch)
tree1726cc52ac593f0efb31273ff9b6cc5fd27106ff
parentc9ac4871679b042664bc56ce814768a5804c3855 (diff)
downloadduser-af3defbdd7628371381ffcd29cda82d653fd2929.tar.gz
Check validity of configuration data
-rw-r--r--src/duser.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/duser.c b/src/duser.c
index 588a7d3..924bff0 100644
--- a/src/duser.c
+++ b/src/duser.c
@@ -82,6 +82,17 @@ int main(int argc, char* argv[])
cfg_get_key(list_path, "path");
cfg_get_key(logfile, "logfile");
cfg_close();
+ errno = 0;
+ if((access(list_path, F_OK)) != 0)
+ {
+ fprintf(stderr, "%s: %s: %s\n", SELF, list_path, strerror(errno));
+ exit(errno);
+ }
+ if((access(logfile, F_OK)) != 0)
+ {
+ fprintf(stderr, "%s: %s: %s\n", SELF, logfile, strerror(errno));
+ exit(errno);
+ }
}
else
{