diff options
| author | bwarsaw | 1999-02-27 19:37:33 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-02-27 19:37:33 +0000 |
| commit | 3916e5af232c524d17a8a1da0ee363922d177c2e (patch) | |
| tree | f4f71cec6b4577138fb7b3ffcb049235f8fbfc0e /src/mail-wrapper.c | |
| parent | 5436b513c2ceb9af2c9a0379f5761b83b2fcd69d (diff) | |
| download | mailman-3916e5af232c524d17a8a1da0ee363922d177c2e.tar.gz mailman-3916e5af232c524d17a8a1da0ee363922d177c2e.tar.zst mailman-3916e5af232c524d17a8a1da0ee363922d177c2e.zip | |
Diffstat (limited to 'src/mail-wrapper.c')
| -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; } |
