mirror of
https://github.com/sonertari/SSLproxy
synced 2024-11-18 03:25:31 +00:00
Check if args to -j and -S are directories
This commit is contained in:
parent
86397dac89
commit
2d97659a6b
12
main.c
12
main.c
@ -483,6 +483,12 @@ main(int argc, char *argv[])
|
|||||||
oom_die(argv0);
|
oom_die(argv0);
|
||||||
break;
|
break;
|
||||||
case 'j':
|
case 'j':
|
||||||
|
if (!sys_isdir(optarg)) {
|
||||||
|
fprintf(stderr, "%s: '%s' is not a "
|
||||||
|
"directory\n",
|
||||||
|
argv0, optarg);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
if (opts->jaildir)
|
if (opts->jaildir)
|
||||||
free(opts->jaildir);
|
free(opts->jaildir);
|
||||||
opts->jaildir = strdup(optarg);
|
opts->jaildir = strdup(optarg);
|
||||||
@ -506,6 +512,12 @@ main(int argc, char *argv[])
|
|||||||
opts->contentlog_isspec = 0;
|
opts->contentlog_isspec = 0;
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
|
if (!sys_isdir(optarg)) {
|
||||||
|
fprintf(stderr, "%s: '%s' is not a "
|
||||||
|
"directory\n",
|
||||||
|
argv0, optarg);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
if (opts->contentlog)
|
if (opts->contentlog)
|
||||||
free(opts->contentlog);
|
free(opts->contentlog);
|
||||||
opts->contentlog = strdup(optarg);
|
opts->contentlog = strdup(optarg);
|
||||||
|
Loading…
Reference in New Issue
Block a user