summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/hexdump/hexdump.c4
-rw-r--r--usr.sbin/tcpdump/privsep.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/hexdump/hexdump.c b/usr.bin/hexdump/hexdump.c
index 9ef015db76c..fc67538ec46 100644
--- a/usr.bin/hexdump/hexdump.c
+++ b/usr.bin/hexdump/hexdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hexdump.c,v 1.14 2010/10/12 17:23:21 millert Exp $ */
+/* $OpenBSD: hexdump.c,v 1.15 2011/04/03 21:10:45 stsp Exp $ */
/* $NetBSD: hexdump.c,v 1.7 1997/10/19 02:34:06 lukem Exp $ */
/*
@@ -32,6 +32,7 @@
#include <sys/param.h>
#include <err.h>
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -73,6 +74,7 @@ main(int argc, char *argv[])
rewrite(tfs);
(void)next(argv);
+ (void)setlocale(LC_CTYPE, "");
display();
exit(exitval);
}
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");