diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-10-19 09:08:06 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-10-19 09:08:06 +0000 |
commit | 606ce456a609f715d65446676b7212d3d4a28715 (patch) | |
tree | 39fa946daf6c49b8b99beb9548cdecad3fa47ce8 | |
parent | 9307e5132f6a7f30ceebced7f49f97de5f741359 (diff) |
keep log_warn messages to be informed when a failure occurs during a reload.
-rw-r--r-- | usr.sbin/hoststated/parse.y | 8 | ||||
-rw-r--r-- | usr.sbin/relayd/parse.y | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/hoststated/parse.y b/usr.sbin/hoststated/parse.y index 414dfa49ffe..460b6078446 100644 --- a/usr.sbin/hoststated/parse.y +++ b/usr.sbin/hoststated/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.68 2007/10/18 20:52:12 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.69 2007/10/19 09:08:05 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -1508,14 +1508,17 @@ check_file_secrecy(int fd, const char *fname) struct stat st; if (fstat(fd, &st)) { + log_warn("cannot stat %s", fname); warn("cannot stat %s", fname); return (-1); } if (st.st_uid != 0 && st.st_uid != getuid()) { + log_warnx("%s: owner not root or current user", fname); warnx("%s: owner not root or current user", fname); return (-1); } if (st.st_mode & (S_IRWXG | S_IRWXO)) { + log_warnx("%s: group/world readable/writeable", fname); warnx("%s: group/world readable/writeable", fname); return (-1); } @@ -1529,10 +1532,12 @@ pushfile(const char *name, int secret) if ((nfile = calloc(1, sizeof(struct file))) == NULL || (nfile->name = strdup(name)) == NULL) { + log_warn("malloc"); warn("malloc"); return (NULL); } if ((nfile->stream = fopen(nfile->name, "r")) == NULL) { + log_warnx("%s", nfile->name); warnx("%s", nfile->name); free(nfile->name); free(nfile); @@ -1576,6 +1581,7 @@ parse_config(const char *filename, int opts) if ((conf = calloc(1, sizeof(*conf))) == NULL || (conf->tables = calloc(1, sizeof(*conf->tables))) == NULL || (conf->services = calloc(1, sizeof(*conf->services))) == NULL) { + log_warn("cannot allocate memory"); warn("cannot allocate memory"); return (NULL); } diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y index 414dfa49ffe..460b6078446 100644 --- a/usr.sbin/relayd/parse.y +++ b/usr.sbin/relayd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.68 2007/10/18 20:52:12 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.69 2007/10/19 09:08:05 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -1508,14 +1508,17 @@ check_file_secrecy(int fd, const char *fname) struct stat st; if (fstat(fd, &st)) { + log_warn("cannot stat %s", fname); warn("cannot stat %s", fname); return (-1); } if (st.st_uid != 0 && st.st_uid != getuid()) { + log_warnx("%s: owner not root or current user", fname); warnx("%s: owner not root or current user", fname); return (-1); } if (st.st_mode & (S_IRWXG | S_IRWXO)) { + log_warnx("%s: group/world readable/writeable", fname); warnx("%s: group/world readable/writeable", fname); return (-1); } @@ -1529,10 +1532,12 @@ pushfile(const char *name, int secret) if ((nfile = calloc(1, sizeof(struct file))) == NULL || (nfile->name = strdup(name)) == NULL) { + log_warn("malloc"); warn("malloc"); return (NULL); } if ((nfile->stream = fopen(nfile->name, "r")) == NULL) { + log_warnx("%s", nfile->name); warnx("%s", nfile->name); free(nfile->name); free(nfile); @@ -1576,6 +1581,7 @@ parse_config(const char *filename, int opts) if ((conf = calloc(1, sizeof(*conf))) == NULL || (conf->tables = calloc(1, sizeof(*conf->tables))) == NULL || (conf->services = calloc(1, sizeof(*conf->services))) == NULL) { + log_warn("cannot allocate memory"); warn("cannot allocate memory"); return (NULL); } |