summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/kadmin/del.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/kadmin/del.c')
-rw-r--r--crypto/heimdal/kadmin/del.c43
1 files changed, 10 insertions, 33 deletions
diff --git a/crypto/heimdal/kadmin/del.c b/crypto/heimdal/kadmin/del.c
index 1697656..a7db479 100644
--- a/crypto/heimdal/kadmin/del.c
+++ b/crypto/heimdal/kadmin/del.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan
+ * Copyright (c) 1997 - 2004 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -32,8 +32,9 @@
*/
#include "kadmin_locl.h"
+#include "kadmin-commands.h"
-RCSID("$Id: del.c,v 1.6 2001/05/07 05:30:50 assar Exp $");
+RCSID("$Id: del.c 16754 2006-02-18 23:29:43Z lha $");
static int
do_del_entry(krb5_principal principal, void *data)
@@ -41,40 +42,16 @@ do_del_entry(krb5_principal principal, void *data)
return kadm5_delete_principal(kadm_handle, principal);
}
-static struct getargs args[] = {
- { "help", 'h', arg_flag, NULL }
-};
-
-static int num_args = sizeof(args) / sizeof(args[0]);
-
-static void
-usage(void)
-{
- arg_printusage (args, num_args, "delete", "principal...");
-}
-
-
int
-del_entry(int argc, char **argv)
+del_entry(void *opt, int argc, char **argv)
{
- int optind = 0;
- int help_flag = 0;
-
int i;
- krb5_error_code ret;
-
- args[0].value = &help_flag;
-
- if(getarg(args, num_args, argc, argv, &optind)) {
- usage ();
- return 0;
- }
- if(optind == argc || help_flag) {
- usage ();
- return 0;
- }
+ krb5_error_code ret = 0;
- for(i = 1; i < argc; i++)
+ for(i = 0; i < argc; i++) {
ret = foreach_principal(argv[i], do_del_entry, "del", NULL);
- return 0;
+ if (ret)
+ break;
+ }
+ return ret != 0;
}
OpenPOWER on IntegriCloud