From 480dd4c52b551479571409bf0e567a8094af3127 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Sat, 18 Sep 2010 12:32:32 +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.3