File Coverage

blib/lib/Plugtools/Plugins/Samba/SIDupdate.pm
Criterion Covered Total %
statement 9 32 28.1
branch 0 8 0.0
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 13 45 28.8


line stmt bran cond sub pod time code
1             package Plugtools::Plugins::Samba::SIDupdate;
2              
3 1     1   27159 use warnings;
  1         2  
  1         36  
4 1     1   6 use strict;
  1         3  
  1         30  
5 1     1   602 use Plugtools::Plugins::Samba;
  1         4  
  1         220  
6              
7             =head1 NAME
8              
9             Plugtools::Plugins::Samba::SIDupdate - Updates a the SIDs for a entry based on the current GID/UID.
10              
11             =head1 VERSION
12              
13             Version 0.0.0
14              
15             =cut
16              
17             our $VERSION = '0.0.0';
18              
19              
20             =head1 SYNOPSIS
21              
22             This should be called after updating the UID/GID of a POSIX account.
23              
24             This is for use with userGIDchange and userUIDchange.
25              
26             =head1 FUNCTIONS
27              
28             =head2 plugin
29              
30             The function that will be called by Plugtools.
31              
32             use Plugtools::Plugins::Samba::SIDupdate;
33             %returned=Plugtools::Plugins::Samba::SIDupdate->plugin(\%opts, \%args);
34            
35             if($returned{error}){
36             print "Error!\n";
37             }
38              
39             =cut
40              
41             sub plugin{
42 0     0 1   my %opts;
43 0 0         if(defined($_[1])){
44 0           %opts= %{$_[1]};
  0            
45             };
46 0           my %args;
47 0 0         if(defined($_[2])){
48 0           %args= %{$_[2]};
  0            
49             };
50            
51 0           my %returned;
52 0           $returned{error}=undef;
53              
54 0           my $pts = Plugtools::Plugins::Samba->new({
55             pt=>$opts{self},
56             ldap=>$opts{ldap}
57             });
58 0 0         if ($pts->{error}) {
59 0           $returned{error}=1;
60 0           $returned{errorString}='Unable to create new Plugtools::Plugins::Samba object. $pts->{error}="'.
61             $pts->{error}.'" $pts->{errorString}="'.$pts->{errorString}.'"';
62 0           warn('Plugtools-Plugins-Samba-SIDupdate plugin:1: '.$returned{errorString});
63 0           return %returned;
64             }
65              
66             $pts->sidUpdateEntry({
67 0           entry=>$opts{entry},
68             });
69 0 0         if ($pts->{error}) {
70 0           $returned{error}=1;
71 0           $returned{errorString}='Plugtools::Plugins::Samba->sidUpdateEntry errored. $pts->{error}="'.
72             $pts->{error}.'" $pts->{errorString}="'.$pts->{errorString}.'"';
73 0           warn('Plugtools-Plugins-Samba-SIDupdate plugin:1: '.$returned{errorString});
74 0           return %returned;
75             }
76              
77 0           return %returned;
78             }
79              
80             =head1 ERROR CODES
81              
82             =head2 1
83              
84             Unable to create new Plugtools::Plugins::Samba object.
85              
86             =head2 2
87              
88             sidUpdate errored
89              
90             =head1 AUTHOR
91              
92             Zane C. Bowers, C<< >>
93              
94             =head1 BUGS
95              
96             Please report any bugs or feature requests to C, or through
97             the web interface at L. I will be notified, and then you'll
98             automatically be notified of progress on your bug as I make changes.
99              
100              
101              
102              
103             =head1 SUPPORT
104              
105             You can find documentation for this module with the perldoc command.
106              
107             perldoc Plugtools::Plugins::Samba::SIDupdate
108              
109              
110             You can also look for information at:
111              
112             =over 4
113              
114             =item * RT: CPAN's request tracker
115              
116             L
117              
118             =item * AnnoCPAN: Annotated CPAN documentation
119              
120             L
121              
122             =item * CPAN Ratings
123              
124             L
125              
126             =item * Search CPAN
127              
128             L
129              
130             =back
131              
132              
133             =head1 ACKNOWLEDGEMENTS
134              
135              
136             =head1 COPYRIGHT & LICENSE
137              
138             Copyright 2009 Zane C. Bowers, all rights reserved.
139              
140             This program is free software; you can redistribute it and/or modify it
141             under the same terms as Perl itself.
142              
143              
144             =cut
145              
146             1; # End of Plugtools::Plugins::Samba::SIDupdate