diff options
author | 2016-02-12 08:12:48 +0000 | |
---|---|---|
committer | 2016-02-12 08:12:48 +0000 | |
commit | c097a3c60578125c55e05075d53ba73edf8cba77 (patch) | |
tree | 868402d36eb045a4607de4195dbebe6fc19a0a93 | |
parent | pledge for "dns" if -A is passed, even with -n. (diff) | |
download | wireguard-openbsd-c097a3c60578125c55e05075d53ba73edf8cba77.tar.xz wireguard-openbsd-c097a3c60578125c55e05075d53ba73edf8cba77.zip |
Exit early with an error if the "_ftp_proxy" user does not exist. This prevents
rc.d waiting up to 30 secs when starting ftp-proxy right after updating from 5.8
because at that point sysmerge(8) would not have had a chance to run yet and the
unpriv user would not exist.
issue reported by sthen@
ok sthen@ benno@ jca@
-rw-r--r-- | usr.sbin/ftp-proxy/ftp-proxy.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/ftp-proxy/ftp-proxy.c b/usr.sbin/ftp-proxy/ftp-proxy.c index 5af8b46b042..366a6fabcac 100644 --- a/usr.sbin/ftp-proxy/ftp-proxy.c +++ b/usr.sbin/ftp-proxy/ftp-proxy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftp-proxy.c,v 1.33 2015/12/22 08:35:17 mmcc Exp $ */ +/* $OpenBSD: ftp-proxy.c,v 1.34 2016/02/12 08:12:48 ajacoutot Exp $ */ /* * Copyright (c) 2004, 2005 Camiel Dobbelaar, <cd@sentia.nl> @@ -706,6 +706,9 @@ main(int argc, char *argv[]) if (getuid() != 0) errx(1, "needs to start as root"); + if (getpwnam(NOPRIV_USER) == NULL) + errx(1, "unknown user %s", NOPRIV_USER); + /* Raise max. open files limit to satisfy max. sessions. */ rlp.rlim_cur = rlp.rlim_max = (2 * max_sessions) + 10; if (setrlimit(RLIMIT_NOFILE, &rlp) == -1) |