|
|
1.1 root 1: /* delete.c - */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/quipu/dish/RCS/delete.c,v 7.0 89/11/23 22:19:59 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/quipu/dish/RCS/delete.c,v 7.0 89/11/23 22:19:59 mrose Rel $
9: *
10: *
11: * $Log: delete.c,v $
12: * Revision 7.0 89/11/23 22:19:59 mrose
13: * Release 6.0
14: *
15: */
16:
17: /*
18: * NOTICE
19: *
20: * Acquisition, use, and distribution of this module and related
21: * materials are subject to the restrictions of a license agreement.
22: * Consult the Preface in the User's Manual for the full terms of
23: * this agreement.
24: *
25: */
26:
27:
28: #include "quipu/util.h"
29: #include "quipu/remove.h"
30:
31: extern DN dn;
32:
33: #define OPT (!frompipe || rps -> ps_byteno == 0 ? opt : rps)
34: #define RPS (!frompipe || opt -> ps_byteno == 0 ? rps : opt)
35: extern char frompipe;
36: extern PS opt, rps;
37:
38: call_delete (argc, argv)
39: int argc;
40: char **argv;
41: {
42: DN dnptr,
43: trail = NULLDN;
44: struct ds_removeentry_arg remove_arg;
45: struct DSError error;
46:
47: if ((argc = service_control (OPT, argc, argv, &remove_arg.rma_common)) == -1)
48: return;
49:
50: if (argc > 1)
51: if (move (argv[1]) == OK)
52: argc--;
53:
54: if (argc != 1) {
55: ps_printf (OPT,"Unknown option %s\n",argv[1]);
56: Usage (argv[0]);
57: return;
58: }
59: remove_arg.rma_object = dn;
60:
61: if (rebind () != OK)
62: return;
63:
64: /* Strong authentication */
65: if (remove_arg.rma_common.ca_security != (struct security_parms *) 0)
66: {
67: struct signature *sign_operation();
68: int encode_DAS_RemoveEntryArgumentData();
69:
70: remove_arg.rma_common.ca_sig =
71: sign_operation((caddr_t)&remove_arg, encode_DAS_RemoveEntryArgumentData);
72: }
73:
74: while (ds_removeentry (&remove_arg, &error) != DS_OK) {
75: if (dish_error (OPT, &error) == 0)
76: return;
77: remove_arg.rma_object = error.ERR_REFERRAL.DSE_ref_candidates->cr_name;
78: }
79:
80: ps_print (RPS, "Removed ");
81: dn_print (RPS, dn, EDBOUT);
82: delete_cache (dn);
83: for (dnptr = dn; dnptr->dn_parent != NULLDN; dnptr = dnptr->dn_parent)
84: trail = dnptr;
85:
86: if (trail != NULLDN)
87: trail->dn_parent = NULLDN;
88: else
89: dn = NULLDN;
90:
91: dn_comp_free (dnptr);
92: ps_print (RPS, "\n");
93: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.