summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbcook <bcook@openbsd.org>2015-02-10 06:03:43 +0000
committerbcook <bcook@openbsd.org>2015-02-10 06:03:43 +0000
commite5b59994dda4ed62cb364c46208dce3b71ed4318 (patch)
treed20cc4d324a6fec0dd5a946896dd383d748b20ec
parentuse correct formatters for s/size_t data types. (diff)
downloadwireguard-openbsd-e5b59994dda4ed62cb364c46208dce3b71ed4318.tar.xz
wireguard-openbsd-e5b59994dda4ed62cb364c46208dce3b71ed4318.zip
be more verbose when logging privsep errors.
ok phessler@ deraadt@
-rw-r--r--usr.sbin/ntpd/ntp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index 4d635755583..5a4e336aeec 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.126 2015/01/13 02:23:33 bcook Exp $ */
+/* $OpenBSD: ntp.c,v 1.127 2015/02/10 06:03:43 bcook Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -121,10 +121,13 @@ ntp_main(int pipe_prnt[2], int fd_ctl, struct ntpd_conf *nconf,
ntp_dns(pipe_dns, nconf, pw);
close(pipe_dns[1]);
- if (stat(pw->pw_dir, &stb) == -1)
- fatal("stat");
- if (stb.st_uid != 0 || (stb.st_mode & (S_IWGRP|S_IWOTH)) != 0)
- fatalx("bad privsep dir permissions");
+ if (stat(pw->pw_dir, &stb) == -1) {
+ fatal("privsep dir %s could not be opened", pw->pw_dir);
+ }
+ if (stb.st_uid != 0 || (stb.st_mode & (S_IWGRP|S_IWOTH)) != 0) {
+ fatalx("bad privsep dir %s permissions: %o",
+ pw->pw_dir, stb.st_mode);
+ }
if (chroot(pw->pw_dir) == -1)
fatal("chroot");
if (chdir("/") == -1)