While here add a unit test
logfd = openat(listfd, logname, O_WRONLY|O_EXCL|O_CREAT, S_IRUSR|S_IWUSR);
if(logfd == -1) {
- log_error(LOG_ARGS, "Could not open %s", logname);
+ log_err("Could not open %s: %s", logname, strerror(errno));
free(logname);
return;
}
atf_check -s exit:0 -o "inline:$helptxt" $mlmmjmaintd -h
echo test@mlmmjtest > lists/ml/control/listaddress
atf_check -s exit:1 -e match:"Could not open the directory containing mailing lists.*: No such file or directory" $mlmmjmaintd -F -d nonexisting
+ chmod -w lists/ml
+ atf_check -s exit:0 -e match:"Could not open maintdlog.* Permission denied" $mlmmjmaintd -F -L lists/ml
+ chmod +w lists/ml
atf_check -s exit:0 $mlmmjmaintd -L lists/ml -F
output="Starting maintenance run at