version 1.60, 2017/06/28 13:37:56 |
version 1.61, 2017/06/28 15:40:54 |
|
|
int opt, idx; |
int opt, idx; |
char *home, *magicpath; |
char *home, *magicpath; |
struct passwd *pw; |
struct passwd *pw; |
FILE *magicfp; |
FILE *magicfp = NULL; |
struct magic *m; |
struct magic *m; |
struct input_file *inf = NULL; |
struct input_file *inf = NULL; |
size_t len, width = 0; |
size_t len, width = 0; |
|
|
tzset(); |
if (pledge("stdio rpath getpw id", NULL) == -1) |
|
err(1, "pledge"); |
|
|
for (;;) { |
for (;;) { |
opt = getopt_long(argc, argv, "bchiLsW", longopts, NULL); |
opt = getopt_long(argc, argv, "bchiLsW", longopts, NULL); |
|
|
} else if (argc == 0) |
} else if (argc == 0) |
usage(); |
usage(); |
|
|
magicfp = NULL; |
|
if (geteuid() != 0 && !issetugid()) { |
if (geteuid() != 0 && !issetugid()) { |
home = getenv("HOME"); |
home = getenv("HOME"); |
if (home == NULL || *home == '\0') { |
if (home == NULL || *home == '\0') { |
|
|
prepare_input(&inf[idx], argv[idx]); |
prepare_input(&inf[idx], argv[idx]); |
} |
} |
} |
} |
|
|
|
tzset(); |
|
|
if (pledge("stdio getpw id", NULL) == -1) |
if (pledge("stdio getpw id", NULL) == -1) |
err(1, "pledge"); |
err(1, "pledge"); |