From 29a94b0e1b9f7bb5824df5d66337a6b26a86a343 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 9 Sep 2013 17:30:32 +0200 Subject: net: move the "net idmap delete" functionality to subcommand "net idmap delete mapping" This is in preparation of adding more types of entries to delete... Signed-off-by: Michael Adam Reviewed-by: Volker Lendecke --- source3/utils/net_idmap.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c index db7587aab4..306b130f6e 100644 --- a/source3/utils/net_idmap.c +++ b/source3/utils/net_idmap.c @@ -516,7 +516,8 @@ static bool delete_args_ok(int argc, const char **argv) return false; } -static int net_idmap_delete(struct net_context *c, int argc, const char **argv) +static int net_idmap_delete_mapping(struct net_context *c, int argc, + const char **argv) { int ret = -1; struct db_context *db; @@ -529,7 +530,7 @@ static int net_idmap_delete(struct net_context *c, int argc, const char **argv) if ( !delete_args_ok(argc,argv) || c->display_usage) { d_printf("%s\n%s", _("Usage:"), - _("net idmap delete [-f] [--db=] \n" + _("net idmap delete mapping [-f] [--db=] \n" " Delete mapping of ID from TDB.\n" " -f\tforce\n" " TDB\tidmap database\n" @@ -570,6 +571,24 @@ done: return ret; } +static int net_idmap_delete(struct net_context *c, int argc, const char **argv) +{ + struct functable func[] = { + { + "mapping", + net_idmap_delete_mapping, + NET_TRANSPORT_LOCAL, + N_("Delete ID mapping"), + N_("net idmap delete mapping \n" + " Delete ID mapping") + }, + {NULL, NULL, 0, NULL, NULL} + }; + + return net_run_function(c, argc, argv, "net idmap delete", func); +} + + static int net_idmap_set_mapping(struct net_context *c, int argc, const char **argv) { @@ -771,9 +790,9 @@ int net_idmap(struct net_context *c, int argc, const char **argv) "delete", net_idmap_delete, NET_TRANSPORT_LOCAL, - N_("Delete ID mapping"), - N_("net idmap delete \n" - " Delete ID mapping") + N_("Delete entries from the ID mapping database"), + N_("net idmap delete\n" + " Delete entries from the ID mapping database") }, { "secret", -- cgit