fiche
fiche copied to clipboard
Check whether the logfile is a regular file. Fixed incomplete privilege drop.
If the requested log file (-l
option) isn't a regular file, fopen
will fail to open it, subsequently passing a NULL
pointer into fclose
which causes a segfault. This patch adds an appropriate file type check and shifts the logic around, so that we only create a new log file if it doesn't already exist.
Adding another commit to this pull request, which fixes incomplete privilege drop in perform_user_change()
.