From simon@comsys.ntu-kpi.kiev.ua  Wed Feb 15 12:47:29 2012
Return-Path: <simon@comsys.ntu-kpi.kiev.ua>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E12D106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 15 Feb 2012 12:47:29 +0000 (UTC)
	(envelope-from simon@comsys.ntu-kpi.kiev.ua)
Received: from comsys.kpi.ua (comsys.kpi.ua [77.47.192.42])
	by mx1.freebsd.org (Postfix) with ESMTP id C0DE78FC16
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 15 Feb 2012 12:47:27 +0000 (UTC)
Received: from pm513-1.comsys.kpi.ua ([10.18.52.101] helo=pm513-1.comsys.ntu-kpi.kiev.ua)
	by comsys.kpi.ua with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.63)
	(envelope-from <simon@comsys.ntu-kpi.kiev.ua>)
	id 1Rxe3j-0008CT-61
	for FreeBSD-gnats-submit@freebsd.org; Wed, 15 Feb 2012 14:34:07 +0200
Received: by pm513-1.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1001)
	id BF7941CC36; Wed, 15 Feb 2012 14:34:07 +0200 (EET)
Message-Id: <20120215123407.GA67226@pm513-1.comsys.ntu-kpi.kiev.ua>
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/net/smbldap-tools 0.9.7 smbldap-useradd does not set all Samba
 attributes

>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:    mm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 15 12:50:12 UTC 2012
>Closed-Date:    Fri Feb 17 13:50:57 UTC 2012
>Last-Modified:  Fri Feb 17 13:50:57 UTC 2012
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->mm 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Feb 15 12:50:30 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165177 

From: Martin Matuska <mm@FreeBSD.org>
To: bug-followup@FreeBSD.org, simon@comsys.ntu-kpi.kiev.ua
Cc:  
Subject: Re: ports/165177: ports/net/smbldap-tools 0.9.7 smbldap-useradd does
 not set all Samba attributes
Date: Wed, 15 Feb 2012 15:13:21 +0100

 Please check if this does the job:
 http://svn.gna.org/viewcvs/smbldap-tools?view=revision&revision=124
 http://svn.gna.org/viewcvs/smbldap-tools?view=revision&revision=125
 
 Thanks
 
 -- 
 Martin Matuska
 FreeBSD committer
 http://blog.vx.sk
 

From: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
To: Martin Matuska <mm@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/165177: ports/net/smbldap-tools 0.9.7 smbldap-useradd does
 not set all Samba attributes
Date: Thu, 16 Feb 2012 13:07:19 +0200

 On Wed, Feb 15, 2012 at 03:13:21PM +0100, Martin Matuska wrote:
 > Please check if this does the job:
 > http://svn.gna.org/viewcvs/smbldap-tools?view=revision&revision=124
 > http://svn.gna.org/viewcvs/smbldap-tools?view=revision&revision=125
 > 
 
 I applied these changes to installed smbldap-tools's programs and looks
 like everything work as expected.  I would prefer my change for
 smbldap-useradd.pl, but this is just a question of optimization and style.

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/165177: commit references a PR
Date: Fri, 17 Feb 2012 13:47:01 +0000 (UTC)

 mm          2012-02-17 13:46:47 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net/smbldap-tools    Makefile 
   Added files:
     net/smbldap-tools/files patch-svn-123_125 
   Log:
   Add patch from vendor SVN.
   
   PR:             ports/161967, ports/165177
   Submitted by:   Andrey Simonenko <simon at comsys.ntu-kpi.kiev.ua>
   
   Revision  Changes    Path
   1.31      +1 -0      ports/net/smbldap-tools/Makefile
   1.1       +35 -0     ports/net/smbldap-tools/files/patch-svn-123_125 (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: mm 
State-Changed-When: Fri Feb 17 13:50:56 UTC 2012 
State-Changed-Why:  
Resolved. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165177 
>Unformatted:
