diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mail-wrapper.c | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/src/mail-wrapper.c b/src/mail-wrapper.c index 7493d5bd8..f1fd79f46 100644 --- a/src/mail-wrapper.c +++ b/src/mail-wrapper.c @@ -40,31 +40,6 @@ const char *VALID_COMMANDS[] = { }; -/* Might want to make this full path. I can write whatever program named - * sendmail, so this isn't much for security. -*/ -const char *LEGAL_PARENT_NAMES[] = { - "sendmail", - NULL /* Sentinel, don't remove */ -}; - - - - -int -check_parent(char *parent) -{ - int i = 0; - - while (LEGAL_PARENT_NAMES[i]) { - if (!strcmp(parent, LEGAL_PARENT_NAMES[i])) - return 1; - i++; - } - return 0; -} - - int check_command(char *command) { @@ -87,16 +62,18 @@ main(int argc, char** argv, char** env) /* sanity check arguments */ if (argc < 2) - fatal(logident, "Usage: %s program [args...]\n", argv[0]); + fatal(logident, MAIL_USAGE_ERROR, + "Usage: %s program [args...]\n", argv[0]); if (!check_command(argv[1])) - fatal(logident, "Illegal command: %s", argv[1]); + fatal(logident, MAIL_ILLEGAL_COMMAND, + "Illegal command: %s", argv[1]); check_caller(logident, parentgid); /* If we got here, everything must be OK */ status = run_script(argv[1], argc, argv, env); - fatal(logident, "%s", strerror(errno)); + fatal(logident, status, "%s", strerror(errno)); return status; } |
