examples:createdombj: default prefix to target-type, not "group"
authorMichael Adam <obnox@samba.org>
Thu, 30 Dec 2010 15:34:59 +0000 (16:34 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 30 Dec 2010 16:22:57 +0000 (17:22 +0100)
It can be irritating to create users named group00001, group00002, ... :-)

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Thu Dec 30 17:22:57 CET 2010 on sn-devel-104

examples/scripts/users_and_groups/createdomobj.pl

index 60f34b84f2361842635c21953272440acd46aa26..919f75ad07699f1445ba1e5367690c2d35044296 100755 (executable)
@@ -39,7 +39,7 @@ my $rpccli_cmd        = "rpcclient";
 my $server;
 my $num_targets        = 1;
 my $startnum;                          # if empty, don't add numbers to prefix
-my $prefix     = $target_type;         # name-prefix
+my $prefix;                            # name-prefix
 my $path;                              # path to rpcclient command
 my $rpccli_path        = $rpccli_cmd;
 my $creds;
@@ -102,6 +102,8 @@ if (exists($options{n})) {
 
 if (exists($options{p})) {
        $prefix = $options{p};
+} else {
+       $prefix = $target_type;
 }
 
 if (exists($options{P})) {