1 /* exitcodes.h -- wrapper around sysextis.h 2 * 3 * Copyright (c) 1994-2008 Carnegie Mellon University. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in 14 * the documentation and/or other materials provided with the 15 * distribution. 16 * 17 * 3. The name "Carnegie Mellon University" must not be used to 18 * endorse or promote products derived from this software without 19 * prior written permission. For permission or any legal 20 * details, please contact 21 * Carnegie Mellon University 22 * Center for Technology Transfer and Enterprise Creation 23 * 4615 Forbes Avenue 24 * Suite 302 25 * Pittsburgh, PA 15213 26 * (412) 268-7393, fax: (412) 268-7395 27 * innovation@andrew.cmu.edu 28 * 29 * 4. Redistributions of any form whatsoever must retain the following 30 * acknowledgment: 31 * "This product includes software developed by Computing Services 32 * at Carnegie Mellon University (http://www.cmu.edu/computing/)." 33 * 34 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 35 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 36 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 37 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 38 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 39 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 40 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 41 */ 42 43 /* Sendmail has some weird ideas on what constitutes permenant failure. On 44 more than one occasion, we have gotten burned by this moving users around 45 through various inadvisable means, screwing up the mailboxes file, 46 whatever. 47 48 We don't want to fail out permenantly on things like EX_USAGE, EX_SOFTWARE, 49 etc., because that generally means someone was just screwing with the mail 50 store and we don't want to lose mail. 51 52 Instead, we map these EC_* codes to EX_* codes, thereby lying to Sendmail, 53 since we don't derive any benefit from Sendmail knowing what the error was. 54 We just want it to retry all the time anyway. This way, should sendmail's 55 behavior be different and we start deriving benefit from Sendmail knowing 56 stuff, we can easily change it back. 57 58 So other code uses the EC_* error, then we maybe change it to TEMPFAIL if 59 we don't agree on whether the error should be permenant or not. 60 61 Comments below stolen from sysexits.h. */ 62 63 #ifndef INCLUDED_EXITCODES_H 64 #define INCLUDED_EXITCODES_H 65 66 #include <sysexits.h> 67 68 #define EC_OK 0 /* successful termination */ 69 70 #define EC_USAGE EX_TEMPFAIL /* command line usage error */ 71 #define EC_DATAERR EX_DATAERR /* data format error */ 72 #define EC_NOINPUT EX_TEMPFAIL /* cannot open input */ 73 #define EC_NOUSER EX_NOUSER /* addressee unknown */ 74 #define EC_NOHOST EX_TEMPFAIL /* host name unknown */ 75 #define EC_UNAVAILABLE EX_TEMPFAIL /* service unavailable */ 76 #define EC_SOFTWARE EX_TEMPFAIL /* internal software error */ 77 #define EC_OSERR EX_TEMPFAIL /* system error (e.g., can't fork) */ 78 #define EC_OSFILE EX_TEMPFAIL /* critical OS file missing */ 79 #define EC_CANTCREAT EX_TEMPFAIL /* can't create (user) output file */ 80 #define EC_IOERR EX_TEMPFAIL /* input/output error */ 81 #define EC_TEMPFAIL EX_TEMPFAIL /* user is invited to retry */ 82 #define EC_PROTOCOL EX_TEMPFAIL /* remote error in protocol */ 83 #define EC_NOPERM EX_NOPERM /* permission denied */ 84 #define EC_CONFIG EX_TEMPFAIL /* configuration error */ 85 86 #endif /* INCLUDED_EXITCODES_H */ 87