summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-10-02 00:43:27 +0200
committerMichael Adam <obnox@samba.org>2013-10-02 12:23:33 +0200
commit280f21a9612982be4ad3e08e39608e6218529980 (patch)
tree3f8aac7358e402cf9e13a68033f86671c5e73b16 /source3
parentb2ed2d814b44f766158ed1891173e8cd561b0e7e (diff)
downloadsamba-280f21a9612982be4ad3e08e39608e6218529980.tar.gz
samba-280f21a9612982be4ad3e08e39608e6218529980.tar.bz2
samba-280f21a9612982be4ad3e08e39608e6218529980.zip
net: allow "net idmap get ranges" to list all ranges
Omission of SID parameter lists ranges for all domains. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Oct 2 12:23:33 CEST 2013 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/net_idmap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c
index 6638312277..de2d50975b 100644
--- a/source3/utils/net_idmap.c
+++ b/source3/utils/net_idmap.c
@@ -1175,9 +1175,9 @@ static void net_idmap_autorid_get_ranges_usage(void)
{
d_printf("%s\n%s",
_("Usage:"),
- _("net idmap get ranges <SID> [--db=<inputfile>]\n"
+ _("net idmap get ranges [<SID>] [--db=<inputfile>]\n"
" Get all ranges for a given domain.\n"
- " SID\t\tSID of the domain\n"
+ " SID\t\tSID of the domain - list all ranges if omitted\n"
" inputfile\tTDB file to add mapping to.\n"));
}
@@ -1195,13 +1195,15 @@ static int net_idmap_autorid_get_ranges(struct net_context *c, int argc,
return 0;
}
- if (argc != 1) {
+ if (argc == 0) {
+ domsid = NULL;
+ } else if (argc == 1) {
+ domsid = argv[0];
+ } else {
net_idmap_autorid_get_ranges_usage();
return -1;
}
- domsid = argv[0];
-
mem_ctx = talloc_stackframe();
if (!net_idmap_opendb_autorid(mem_ctx, c, true, &db)) {
goto done;