Deleted Added
full compact
sysexits.c (98121) sysexits.c (110560)
1/*
2 * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
11 *
12 */
13
14#include <sendmail.h>
15
1/*
2 * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
11 *
12 */
13
14#include <sendmail.h>
15
16SM_RCSID("@(#)$Id: sysexits.c,v 8.33 2001/09/11 04:05:17 gshapiro Exp $")
16SM_RCSID("@(#)$Id: sysexits.c,v 8.33.4.1 2002/09/09 02:42:37 gshapiro Exp $")
17
18/*
19** DSNTOEXITSTAT -- convert DSN-style error code to EX_ style.
20**
21** Parameters:
22** dsncode -- the text of the DSN-style code.
23**
24** Returns:

--- 7 unchanged lines hidden (view full) ---

32 int code2, code3;
33
34 /* first the easy cases.... */
35 if (*dsncode == '2')
36 return EX_OK;
37 if (*dsncode == '4')
38 return EX_TEMPFAIL;
39
17
18/*
19** DSNTOEXITSTAT -- convert DSN-style error code to EX_ style.
20**
21** Parameters:
22** dsncode -- the text of the DSN-style code.
23**
24** Returns:

--- 7 unchanged lines hidden (view full) ---

32 int code2, code3;
33
34 /* first the easy cases.... */
35 if (*dsncode == '2')
36 return EX_OK;
37 if (*dsncode == '4')
38 return EX_TEMPFAIL;
39
40 /* reject other illegal values */
41 if (*dsncode != '5')
42 return EX_CONFIG;
43
40 /* now decode the other two field parts */
41 if (*++dsncode == '.')
42 dsncode++;
43 code2 = atoi(dsncode);
44 while (*dsncode != '\0' && *dsncode != '.')
45 dsncode++;
46 if (*dsncode != '\0')
47 dsncode++;

--- 22 unchanged lines hidden (view full) ---

70 case 3: /* Bad destination mailbox address syntax */
71 case 7: /* Bad senders mailbox address syntax */
72 return EX_USAGE;
73
74 case 4: /* Destination mailbox address ambiguous */
75 return EX_UNAVAILABLE;
76
77 case 5: /* Destination address valid */
44 /* now decode the other two field parts */
45 if (*++dsncode == '.')
46 dsncode++;
47 code2 = atoi(dsncode);
48 while (*dsncode != '\0' && *dsncode != '.')
49 dsncode++;
50 if (*dsncode != '\0')
51 dsncode++;

--- 22 unchanged lines hidden (view full) ---

74 case 3: /* Bad destination mailbox address syntax */
75 case 7: /* Bad senders mailbox address syntax */
76 return EX_USAGE;
77
78 case 4: /* Destination mailbox address ambiguous */
79 return EX_UNAVAILABLE;
80
81 case 5: /* Destination address valid */
78 return EX_OK;
82 /* According to RFC1893, this can't happen */
83 return EX_CONFIG;
79 }
80 break;
81
82 case 2: /* Mailbox Status */
83 switch (code3)
84 {
85 case 0: /* Other or Undefined mailbox status */
86 case 1: /* Mailbox disabled, not accepting messages */

--- 38 unchanged lines hidden (view full) ---

125 return EX_PROTOCOL;
126
127 case 6: /* Message Content or Media Status */
128 return EX_UNAVAILABLE;
129
130 case 7: /* Security Status */
131 return EX_DATAERR;
132 }
84 }
85 break;
86
87 case 2: /* Mailbox Status */
88 switch (code3)
89 {
90 case 0: /* Other or Undefined mailbox status */
91 case 1: /* Mailbox disabled, not accepting messages */

--- 38 unchanged lines hidden (view full) ---

130 return EX_PROTOCOL;
131
132 case 6: /* Message Content or Media Status */
133 return EX_UNAVAILABLE;
134
135 case 7: /* Security Status */
136 return EX_DATAERR;
137 }
133 return EX_CONFIG;
138 return EX_UNAVAILABLE;
134}
135/*
136** EXITSTAT -- convert EX_ value to error text.
137**
138** Parameters:
139** excode -- rstatus which might consists of an EX_* value.
140**
141** Returns:

--- 21 unchanged lines hidden ---
139}
140/*
141** EXITSTAT -- convert EX_ value to error text.
142**
143** Parameters:
144** excode -- rstatus which might consists of an EX_* value.
145**
146** Returns:

--- 21 unchanged lines hidden ---