|
|
1.1 root 1: /* ds_error.c - Directory Operation Errors */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/dsap/common/RCS/ds_error.c,v 7.2 90/03/15 11:17:31 mrose Exp $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/dsap/common/RCS/ds_error.c,v 7.2 90/03/15 11:17:31 mrose Exp $
9: *
10: *
11: * $Log: ds_error.c,v $
12: * Revision 7.2 90/03/15 11:17:31 mrose
13: * quipu-sync
14: *
15: * Revision 7.1 89/12/19 16:19:20 mrose
16: * sync
17: *
18: * Revision 7.0 89/11/23 21:42:08 mrose
19: * Release 6.0
20: *
21: */
22:
23: /*
24: * NOTICE
25: *
26: * Acquisition, use, and distribution of this module and related
27: * materials are subject to the restrictions of a license agreement.
28: * Consult the Preface in the User's Manual for the full terms of
29: * this agreement.
30: *
31: */
32:
33:
34: /* LINTLIBRARY */
35:
36: #include "quipu/util.h"
37: #include "quipu/name.h"
38: #include "quipu/dsp.h"
39: #include "quipu/ds_error.h"
40: #include "quipu/bind.h"
41:
42: extern LLog * log_dsap;
43:
44: extern int dn_print ();
45: extern int AttrT_print ();
46: int dsa_dead;
47:
48: static char * abandon_fail [] = {
49: "No error !!!",
50: "No such operation",
51: "Too late",
52: "Cannot abandon"
53: };
54:
55: static char * at_problem [] = {
56: "No error !!!",
57: "No such attribute in the entry",
58: "Invalid attribute syntax",
59: "Undefined Attribute type",
60: "Inappropriate Matching",
61: "Constrain violation",
62: "Attribute or Value already exists"
63: };
64:
65: static char * name [] = {
66: "No error !!!",
67: "No such object",
68: "Alias problem",
69: "Invalid attribute syntax",
70: "Alias dereference"
71: };
72:
73: static char * security [] = {
74: "No error !!!",
75: "Inappropriate authentication",
76: "Invalid credentials",
77: "Access rights",
78: "Invalid signature",
79: "Protection required",
80: "No information"
81: };
82:
83: static char * service [] = {
84: "No error !!!",
85: "Busy",
86: "Unavailable",
87: "Unwilling to perform",
88: "Chaining required",
89: "Unable to proceed",
90: "Invalid Reference",
91: "Timelimit exceeded",
92: "Administrative limit exceeded",
93: "Loop detect",
94: "Unavailable critical extension",
95: "Out of scope",
96: "DIT error"
97: };
98:
99: static char * update [] = {
100: "No error !!!",
101: "Naming violation",
102: "Object class violation",
103: "Only allowed on leaf entries",
104: "Can't alter the RDN",
105: "Already exists",
106: "Affects multiple DSAs",
107: "Object class modifications Prohibited"
108: };
109:
110: ds_error (ps,err)
111: PS ps;
112: struct DSError *err;
113: {
114: struct DSE_at_problem *at_prob;
115:
116: switch (err->dse_type) {
117: case DSE_NOERROR:
118: ps_print (ps,"No error !!!\n");
119: break;
120: case DSE_ABANDON_FAILED:
121: ps_printf (ps,"*** Abandon failure: %s, id %d ***\n" ,abandon_fail[err->ERR_ABANDON_FAIL.DSE_ab_problem], err->ERR_ABANDON_FAIL.DSE_ab_invokeid);
122: break;
123: case DSE_ATTRIBUTEERROR:
124: ps_print (ps,"*** Attribute error ***\n");
125: dn_print (ps,err->ERR_ATTRIBUTE.DSE_at_name, RDNOUT);
126: ps_print (ps,"\n");
127: for (at_prob = &err->ERR_ATTRIBUTE.DSE_at_plist; at_prob != DSE_AT_NOPROBLEM; at_prob = at_prob -> dse_at_next) {
128: ps_print (ps,"Attribute type ");
129: AttrT_print (ps,at_prob->DSE_at_type,READOUT);
130: if (at_prob->DSE_at_value != NULLAttrV) {
131: ps_print (ps,", value ");
132: AttrV_print (ps,at_prob->DSE_at_value,READOUT);
133: }
134: ps_printf (ps," - %s\n", at_problem[at_prob->DSE_at_what]);
135: }
136: break;
137: case DSE_NAMEERROR:
138: ps_printf (ps,"*** Name error: %s ***\n( Matched: ",name[err->ERR_NAME.DSE_na_problem]);
139: dn_print (ps,err->ERR_NAME.DSE_na_matched,RDNOUT);
140: ps_print (ps," )\n");
141: break;
142: case DSE_SERVICEERROR:
143: ps_printf (ps,"*** Service error: %s ***\n", service[err->ERR_SERVICE.DSE_sv_problem] );
144: break;
145: case DSE_REFERRAL:
146: if (err->ERR_REFERRAL.DSE_ref_candidates == NULLCONTINUATIONREF) {
147: ps_print (ps,"*** Can't contact remote DSA - Address Unknown ***\n");
148: break;
149: }
150: ps_print (ps,"*** Referral to \"");
151: dn_print (ps,err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints->ap_name,RDNOUT);
152: ps_printf (ps,"\" ***\n");
153: /*
154: ps_printf (ps,"\" ***\n (%s)\n", paddr2str (err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints->ap_address,NULLNA));
155: */
156: break;
157: case DSE_DSAREFERRAL:
158: if (err->ERR_REFERRAL.DSE_ref_candidates == NULLCONTINUATIONREF) {
159: ps_print (ps,"*** Referral error - Null reference ***\n");
160: break;
161: }
162: ps_print (ps,"*** DSA Referral error - ");
163: dn_print (ps,err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints->ap_name,RDNOUT);
164: ps_printf (ps," - %s ***\n", paddr2str (err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints->ap_address,NULLNA));
165: dn_print (ps,err->ERR_REFERRAL.DSE_ref_prefix,RDNOUT);
166: break;
167: case DSE_SECURITYERROR:
168: ps_printf (ps,"*** Security error - %s ***\n",security[err->ERR_SECURITY.DSE_sc_problem]);
169: break;
170: case DSE_UPDATEERROR:
171: ps_printf (ps,"*** Update error - %s ***\n",update[err->ERR_UPDATE.DSE_up_problem]);
172: break;
173: case DSE_ABANDONED:
174: ps_print (ps,"*** Abandoned error ***\n");
175: break;
176: case DSE_REMOTEERROR:
177: dsa_dead = TRUE;
178: ps_print (ps,"*** Problem with DSA ***\n");
179: break;
180: case DSE_LOCALERROR:
181: ps_print (ps,"*** Problem with DUA ***\n");
182: break;
183: case DSE_INTR_ABANDON_FAILED:
184: ps_print (ps,"*** Abandoned Failed ***\n");
185: break;
186: case DSE_INTR_ABANDONED:
187: ps_print (ps,"*** Abandoned ***\n");
188: break;
189: case DSE_INTRERROR:
190: ps_print (ps,"*** Interrupted ***\n");
191: break;
192: default:
193: dsa_dead = TRUE;
194: ps_printf (ps,"*** Undefined error '%d' ***\n",err->dse_type);
195: break;
196: }
197:
198: ds_error_free (err);
199:
200: }
201:
202:
203: log_ds_error (err)
204: struct DSError *err;
205: {
206: struct DSE_at_problem *at_prob;
207:
208: switch (err->dse_type) {
209: case DSE_NOERROR:
210: LLOG (log_dsap,LLOG_EXCEPTIONS,("No error !!!"));
211: break;
212: case DSE_ABANDON_FAILED:
213: LLOG (log_dsap,LLOG_EXCEPTIONS,("Abandon failure"));
214: LLOG (log_dsap,LLOG_TRACE,("%s,id %d" ,abandon_fail[err->ERR_ABANDON_FAIL.DSE_ab_problem], err->ERR_ABANDON_FAIL.DSE_ab_invokeid));
215: break;
216: case DSE_ATTRIBUTEERROR:
217: LLOG (log_dsap,LLOG_EXCEPTIONS,("Attribute error\n"));
218: pslog (log_dsap,LLOG_TRACE,"...",dn_print,(caddr_t)err->ERR_ATTRIBUTE.DSE_at_name);
219: for (at_prob = &err->ERR_ATTRIBUTE.DSE_at_plist; at_prob != DSE_AT_NOPROBLEM; at_prob = at_prob -> dse_at_next) {
220: LLOG (log_dsap,LLOG_TRACE, (at_problem[at_prob->DSE_at_what]));
221: if (at_prob->DSE_at_value != NULLAttrV)
222: pslog (log_dsap,LLOG_TRACE,"type", AttrT_print, (caddr_t) at_prob->DSE_at_type);
223: }
224: break;
225: case DSE_NAMEERROR:
226: LLOG (log_dsap,LLOG_EXCEPTIONS,("Name error: %s",name[err->ERR_NAME.DSE_na_problem]));
227: pslog (log_dsap,LLOG_TRACE,"matched name",dn_print, (caddr_t)err->ERR_NAME.DSE_na_matched);
228: break;
229: case DSE_SERVICEERROR:
230: LLOG (log_dsap,LLOG_EXCEPTIONS,("Service error: %s ", service[err->ERR_SERVICE.DSE_sv_problem] ));
231: break;
232: case DSE_REFERRAL:
233: LLOG (log_dsap,LLOG_EXCEPTIONS,("Referral error"));
234: if (err->ERR_REFERRAL.DSE_ref_candidates == NULLCONTINUATIONREF) {
235: LLOG (log_dsap,LLOG_EXCEPTIONS,("NULL reference in referral error"));
236: break;
237: }
238: pslog (log_dsap,LLOG_TRACE,"ap_name",dn_print, (caddr_t)err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints->ap_name);
239: break;
240: case DSE_DSAREFERRAL:
241: LLOG (log_dsap,LLOG_EXCEPTIONS,("DSA!! Referral error"));
242: if (err->ERR_REFERRAL.DSE_ref_candidates == NULLCONTINUATIONREF) {
243: LLOG (log_dsap,LLOG_EXCEPTIONS,("NULL reference in DSA referral error"));
244: break;
245: }
246: pslog (log_dsap,LLOG_TRACE,"ap_name",dn_print, (caddr_t)err->ERR_REFERRAL.DSE_ref_candidates->cr_accesspoints->ap_name);
247: break;
248: case DSE_SECURITYERROR:
249: LLOG (log_dsap,LLOG_EXCEPTIONS,("Security error - %s ",security[err->ERR_SECURITY.DSE_sc_problem]));
250: break;
251: case DSE_UPDATEERROR:
252: LLOG (log_dsap,LLOG_EXCEPTIONS,("Update error - %s ",update[err->ERR_UPDATE.DSE_up_problem]));
253: break;
254: case DSE_ABANDONED:
255: LLOG (log_dsap,LLOG_EXCEPTIONS,("Abandoned error"));
256: break;
257: case DSE_REMOTEERROR:
258: LLOG (log_dsap, LLOG_EXCEPTIONS,("remote DSA error !!!"));
259: break;
260: case DSE_LOCALERROR:
261: LLOG (log_dsap, LLOG_EXCEPTIONS,("local DUA error !!!"));
262: break;
263: case DSE_INTR_ABANDON_FAILED:
264: LLOG (log_dsap, LLOG_EXCEPTIONS,("Abandon failed !!!"));
265: break;
266: case DSE_INTR_ABANDONED:
267: LLOG (log_dsap, LLOG_EXCEPTIONS,("Abandoned !!!"));
268: break;
269: case DSE_INTRERROR:
270: LLOG (log_dsap, LLOG_EXCEPTIONS,("Interrupted !!!"));
271: break;
272: default:
273: LLOG (log_dsap,LLOG_EXCEPTIONS,("Unknown ds error type (%d)",err->dse_type));
274: break;
275: }
276:
277: }
278:
279:
280: ds_error_free (err)
281: struct DSError * err;
282: {
283: register struct DSE_at_problem *at_prob;
284:
285: switch (err->dse_type) {
286: case DSE_ATTRIBUTEERROR:
287: dn_free (err->ERR_ATTRIBUTE.DSE_at_name);
288: at_prob = &err->ERR_ATTRIBUTE.DSE_at_plist;
289: if (at_prob->DSE_at_value != NULLAttrV)
290: AttrV_free (at_prob->DSE_at_value);
291: if (at_prob->DSE_at_type != NULLAttrT)
292: AttrT_free (at_prob->DSE_at_type);
293:
294: for (at_prob = at_prob->dse_at_next; at_prob != DSE_AT_NOPROBLEM; at_prob = at_prob -> dse_at_next) {
295: if (at_prob->DSE_at_value != NULLAttrV)
296: AttrV_free (at_prob->DSE_at_value);
297: if (at_prob->DSE_at_type != NULLAttrT)
298: AttrT_free (at_prob->DSE_at_type);
299: free ((char *) at_prob);
300: }
301: break;
302: case DSE_NAMEERROR:
303: dn_free (err->ERR_NAME.DSE_na_matched);
304: break;
305: case DSE_REFERRAL:
306: if(err->ERR_REFERRAL.DSE_ref_prefix != NULLDN)
307: LLOG(log_dsap,LLOG_EXCEPTIONS,("SCREAM! prefix in referral"));
308: /* fall */
309: case DSE_DSAREFERRAL:
310: dn_free (err->ERR_REFERRAL.DSE_ref_prefix);
311: crefs_free (err->ERR_REFERRAL.DSE_ref_candidates);
312: break;
313: default:
314: break;
315: }
316:
317: err->dse_type = DSE_NOERROR;
318:
319: }
320:
321: ds_bind_error(ps, err)
322: PS ps;
323: struct ds_bind_error *err;
324: {
325:
326: switch (err->dbe_type) {
327: case DBE_TYPE_SERVICE:
328: ps_printf(ps, "*** Service error : %s ***\n",
329: service[err->dbe_value]);
330: break;
331: case DBE_TYPE_SECURITY:
332: ps_printf(ps, "*** Security error : %s ***\n",
333: security[err->dbe_value]);
334: break;
335: default:
336: ps_printf(ps, "*** Unrecognised bind error! ***");
337: break;
338: }
339: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.