=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/file/file.c,v retrieving revision 1.60 retrieving revision 1.61 diff -c -r1.60 -r1.61 *** src/usr.bin/file/file.c 2017/06/28 13:37:56 1.60 --- src/usr.bin/file/file.c 2017/06/28 15:40:54 1.61 *************** *** 1,4 **** ! /* $OpenBSD: file.c,v 1.60 2017/06/28 13:37:56 brynet Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: file.c,v 1.61 2017/06/28 15:40:54 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott *************** *** 104,115 **** int opt, idx; char *home, *magicpath; struct passwd *pw; ! FILE *magicfp; struct magic *m; struct input_file *inf = NULL; size_t len, width = 0; ! tzset(); for (;;) { opt = getopt_long(argc, argv, "bchiLsW", longopts, NULL); --- 104,116 ---- int opt, idx; char *home, *magicpath; struct passwd *pw; ! FILE *magicfp = NULL; struct magic *m; struct input_file *inf = NULL; size_t len, width = 0; ! if (pledge("stdio rpath getpw id", NULL) == -1) ! err(1, "pledge"); for (;;) { opt = getopt_long(argc, argv, "bchiLsW", longopts, NULL); *************** *** 149,155 **** } else if (argc == 0) usage(); - magicfp = NULL; if (geteuid() != 0 && !issetugid()) { home = getenv("HOME"); if (home == NULL || *home == '\0') { --- 150,155 ---- *************** *** 182,187 **** --- 182,189 ---- prepare_input(&inf[idx], argv[idx]); } } + + tzset(); if (pledge("stdio getpw id", NULL) == -1) err(1, "pledge");