Samba 3: added Samba 3.0.24 sources
[tomato.git] / release / src / router / samba3 / examples / LDAP / smbldap-tools-0.9.2 / smbldap-groupshow
blob3c0a28d47f5ca8f6a42723204363eebc5b94d3fb
1 #!/usr/bin/perl -w
3 # $Id: smbldap-groupshow,v 1.8 2005/10/31 15:05:22 jtournier Exp $
5 # This code was developped by IDEALX (http://IDEALX.org/) and
6 # contributors (their names can be found in the CONTRIBUTORS file).
8 # Copyright (C) 2001-2002 IDEALX
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License
12 # as published by the Free Software Foundation; either version 2
13 # of the License, or (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23 # USA.
25 # Purpose of smbldap-groupshow : user (posix,shadow,samba) display
27 # History :
28 # . originally by David Le Corfec <david.le-corfec@IDEALX.com>
30 use strict;
31 use FindBin;
32 use FindBin qw($RealBin);
33 use lib "$RealBin/";
34 use smbldap_tools;
35 use Getopt::Std;
36 my %Options;
38 my $ok = getopts('?', \%Options);
40 if ( (!$ok) || (@ARGV < 1) || ($Options{'?'}) ) {
41 print_banner;
42 print "Usage: $0 [-?] group\n";
43 print " -? show this help message\n";
44 exit (1);
47 # Read only first @ARGV
48 my $group = $ARGV[0];
50 my $ldap_slave=connect_ldap_slave();
52 my $lines = read_group($group);
53 if (!defined($lines)) {
54 print "group $group doesn't exist\n";
55 exit (1);
58 print "$lines\n";
60 # take down session
61 $ldap_slave->unbind;
63 exit(0);
65 ############################################################
67 =head1 NAME
69 smbldap-groupshow - Display group informations
71 =head1 SYNOPSIS
73 smbldap-groupshow groupname
75 =head1 DESCRIPTION
77 The smbldap-groupshow command displays informations associated with the given group.
79 =cut