ports/165177: ports/net/smbldap-tools 0.9.7 smbldap-useradd does not set all Samba attributes
Andrey Simonenko
simon at comsys.ntu-kpi.kiev.ua
Wed Feb 15 12:50:13 UTC 2012
>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:
More information about the freebsd-ports-bugs
mailing list