summaryrefslogtreecommitdiffstats
path: root/src/phmain.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2019-04-29 19:22:57 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2019-04-29 19:22:57 +0200
commitb45cb7fb4556d8822751c9fe5e29b028c747c804 (patch)
tree58c19e1da86cb1ac74dd7964af37660fbc549db8 /src/phmain.c
parentbfe4aad16cfc99f142c75f914d536d10b551188b (diff)
Avoid two logging prompts when using sudo.
Close https://github.com/cgsecurity/testdisk/issues/61
Diffstat (limited to 'src/phmain.c')
-rw-r--r--src/phmain.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/phmain.c b/src/phmain.c
index 6a9c382..0949376 100644
--- a/src/phmain.c
+++ b/src/phmain.c
@@ -182,6 +182,10 @@ int main( int argc, char **argv )
}
logfile=argv[++i];
}
+ else if((strcmp(argv[i],"/nolog")==0) ||(strcmp(argv[i],"-nolog")==0))
+ {
+ create_log=TD_LOG_NONE;
+ }
else if((strcmp(argv[i],"/log")==0) ||(strcmp(argv[i],"-log")==0))
{
if(create_log==TD_LOG_NONE)
@@ -387,7 +391,7 @@ int main( int argc, char **argv )
printf("PhotoRec will try to restart itself using the sudo command to get\n");
printf("root (superuser) privileges.\n");
printf("\n");
- run_sudo(argc, argv);
+ run_sudo(argc, argv, create_log);
}
#endif
delete_list_disk(list_disk);