diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-22 04:08:18 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-22 04:08:18 +0000 |
commit | ba45a43223153fb284fd464aa890b93c8700f6b7 (patch) | |
tree | 71ce55cd70ca5fcba475ed9fe773686a552bbc8e /usr.bin/awk | |
parent | 8a81ca1c3d7f2f25aa4fe79da3c6ed89d47aab24 (diff) |
Until we understand the sitaution better, we should pledge() after
setlocale(), not before. Not just here, but probably everywhere?
Diffstat (limited to 'usr.bin/awk')
-rw-r--r-- | usr.bin/awk/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/awk/main.c b/usr.bin/awk/main.c index 6252251001f..82996bc6f71 100644 --- a/usr.bin/awk/main.c +++ b/usr.bin/awk/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.18 2015/10/10 20:04:28 doug Exp $ */ +/* $OpenBSD: main.c,v 1.19 2015/10/22 04:08:17 deraadt Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved @@ -61,14 +61,15 @@ int main(int argc, char *argv[]) { const char *fs = NULL; + setlocale(LC_ALL, ""); + setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */ + if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1) { fprintf(stderr, "%s: pledge: incorrect arguments\n", cmdname); exit(1); } - setlocale(LC_ALL, ""); - setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */ cmdname = __progname; if (argc == 1) { fprintf(stderr, "usage: %s [-safe] [-V] [-d[n]] [-F fs] " |