I've found a little bug on smbldap-usermod, regarding the 'M' switch.

Substantially, the option are exploded on commas, then a default domain
are added but the array are not merge back.
Also, a little inefficiency are here, $config{mailDomain} are called
for every 'foreach' cycle, and not only once.

My little patch:

--- smbldap-tools-0.9.7/smbldap-usermod.pl      2012-03-02 17:30:18.160785570 
+0100
+++ dev/smbldap-usermod.pl      2012-03-02 17:28:20.832787276 +0100
@@ -463,12 +463,14 @@
     if ( $tmp =~ s/^([+-])+\s*// ) {
         $action = $1;
     }
-    my @mail = &split_arg_comma($tmp);
-    foreach my $m (@mail) {
-        my $domain = $config{mailDomain};
+    my @tmpm = &split_arg_comma($tmp);
+    my @mail;
+    my $domain = $config{mailDomain};
+    foreach my $m (@tmpm) {
         if ( $m !~ /^(.+)@/ ) {
             $m = $m . ( $domain ? '@' . $domain : '' );
         }
+        push(@mail, $m);
     }
     if ($action) {
         my @old_mail;


Seems also to me that, with the options -M and -O, there's no way to
remove the data, eg using:

        smbldap-usermod -M "" -O "" user

does not remove the current data; i've to investigate further...


PS: better to put that patch on BTS/forge/... ?! It is the same? Some
 feedback from the author welcomed.

-- 
dott. Marco Gaiarin                                 GNUPG Key ID: 240A3D66
  Associazione ``La Nostra Famiglia''                http://www.sv.lnf.it/
  Polo FVG  -  Via della Bontà, 7 - 33078  -  San Vito al Tagliamento (PN)
  marco.gaiarin(at)sv.lnf.it      tel +39-0434-842711  fax +39-0434-842797

                Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA!
           http://www.lanostrafamiglia.it/chi_siamo/5xmille.php
        (cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)

_______________________________________________
Smbldap-tools-tech mailing list
Smbldap-tools-tech@gna.org
https://mail.gna.org/listinfo/smbldap-tools-tech

Reply via email to