From 1c74d05aaae7ccca48b3407149d97a7f76a23f0f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Wed, 14 Jul 2010 18:15:07 +0000 Subject: [PATCH] Report an error if the output directory is a subdirectory of the temporary directory. --- log.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/log.c b/log.c index 34d1f63..1936041 100644 --- a/log.c +++ b/log.c @@ -613,6 +613,11 @@ int main(int argc,char *argv[]) */ strcat(tmp,"/sarg"); + if (tmp[0]!='\0' && strncmp(outdir,tmp,strlen(tmp))==0) { + debuga(_("The output directory \"%s\" must be outside of the temporary directory \"%s\"\n"),outdir,tmp); + exit(EXIT_FAILURE); + } + if(df[0] == '\0') strcpy(df,DateFormat); else strcpy(DateFormat,df); -- 2.47.2