Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2012 14:34:07 +0200
From:      Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/165177: ports/net/smbldap-tools 0.9.7 smbldap-useradd does not set all Samba attributes
Message-ID:  <20120215123407.GA67226@pm513-1.comsys.ntu-kpi.kiev.ua>
Resent-Message-ID: <201202151250.q1FCoC0c057299@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         165177
>Category:       ports
>Synopsis:       ports/net/smbldap-tools 0.9.7 smbldap-useradd does not set all Samba attributes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 15 12:50:12 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Andrey Simonenko
>Release:        FreeBSD 9.0-STABLE amd64
>Organization:
>Environment:
>Description:

The @adds array is declared as a local variable in one place in
smbldap-useradd.pl, and later its value is checked outside of its
declaration scope.  As a result just added Samba user will not get
some Samba attributes.

If this change goes to smbldap-tools port, then please do not
forget about ports/161967.

>How-To-Repeat:
>Fix:

Apply this change to smbldap-tools sources or as a patch for
the smbldap-tools port:

--- smbldap-useradd.pl.orig	2011-09-05 18:53:02.000000000 +0300
+++ smbldap-useradd.pl	2012-01-31 11:33:20.000000000 +0200
@@ -598,7 +598,7 @@
     $tmp = defined( $Options{'F'} ) ? $Options{'F'} : $config{userProfile};
     my $valprofilepath = &subst_user( $tmp, $userName );
 
-    my @adds = ();
+    @adds = ();
 
     if ($valhomedrive) {
         push( @adds, 'sambaHomeDrive' => $valhomedrive );
@@ -618,13 +618,12 @@
         push( @adds, 'sambaLMPassword'      => "XXX" );
         push( @adds, 'sambaNTPassword'      => "XXX" );
     }
-}
-
-if (@adds) {
-    my $modify =
-      $ldap_master->modify( "uid=$userName,$config{usersdn}", add => {@adds} );
+    if (@adds) {
+        my $modify =
+          $ldap_master->modify( "uid=$userName,$config{usersdn}", add => {@adds} );
 
-    $modify->code && die "failed to add entry: ", $modify->error;
+        $modify->code && die "failed to add entry: ", $modify->error;
+    }
 }
 
 # add AIX user
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120215123407.GA67226>