diff options
author | stsp <stsp@openbsd.org> | 2011-04-03 21:10:45 +0000 |
---|---|---|
committer | stsp <stsp@openbsd.org> | 2011-04-03 21:10:45 +0000 |
commit | 0065bb85aca5834c9930fbdf2a69aa4860a86ef1 (patch) | |
tree | 72d4e8d53d477dac96cf8b3df4417f33946746eb /usr.sbin/tcpdump/privsep.c | |
parent | Don't fill the ctype tab with Latin-1 information in UTF-8 locales. (diff) | |
download | wireguard-openbsd-0065bb85aca5834c9930fbdf2a69aa4860a86ef1.tar.xz wireguard-openbsd-0065bb85aca5834c9930fbdf2a69aa4860a86ef1.zip |
Call setlocale() to avoid display glitches in UTF-8 locales.
ok phessler nicm mikeb
Diffstat (limited to 'usr.sbin/tcpdump/privsep.c')
-rw-r--r-- | usr.sbin/tcpdump/privsep.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/tcpdump/privsep.c b/usr.sbin/tcpdump/privsep.c index 9e9f6376655..cf428abbfe8 100644 --- a/usr.sbin/tcpdump/privsep.c +++ b/usr.sbin/tcpdump/privsep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep.c,v 1.28 2009/04/17 22:31:24 jmc Exp $ */ +/* $OpenBSD: privsep.c,v 1.29 2011/04/03 21:11:27 stsp Exp $ */ /* * Copyright (c) 2003 Can Erkin Acar @@ -32,6 +32,7 @@ #include <err.h> #include <errno.h> #include <fcntl.h> +#include <locale.h> #include <netdb.h> #include <paths.h> #include <pwd.h> @@ -162,6 +163,9 @@ priv_init(int argc, char **argv) if (pw == NULL) errx(1, "unknown user _tcpdump"); + /* set the locale before chrooting */ + (void)setlocale(LC_CTYPE, ""); + /* chroot, drop privs and return */ if (chroot(pw->pw_dir) != 0) err(1, "unable to chroot"); |