mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
tools: Return a better error message if sendmail is not usable.
* tools/send-mail.c: Include unistd.h (run_sendmail): Check for bad sendmail. -- GnuPG-bug-id: 6321
This commit is contained in:
parent
103acfe9ca
commit
3ab6538433
@ -22,6 +22,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h> /* for X_OK */
|
||||
|
||||
#include "../common/util.h"
|
||||
#include "../common/exectool.h"
|
||||
@ -36,6 +37,12 @@ run_sendmail (estream_t data)
|
||||
const char pgmname[] = NAME_OF_SENDMAIL;
|
||||
const char *argv[3];
|
||||
|
||||
if (!*pgmname || gnupg_access (pgmname, X_OK))
|
||||
{
|
||||
log_error ("sendmail tool '%s' is not correctly installed\n", pgmname);
|
||||
return gpg_error (GPG_ERR_ENOENT);
|
||||
}
|
||||
|
||||
argv[0] = "-oi";
|
||||
argv[1] = "-t";
|
||||
argv[2] = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user