I have search everywhere but i cant get any help. I have drupal installed and works perfect with my ldap server. It syncs and authenticates the passwords with no problem. But the problem is that drupal only changes de user password. Can i make drupal change the samba password at the same time. I am running a pdc wich authentificates with ldap also.
Thanks a lot in advance.

Comments

scafmac’s picture

Priority: Critical » Normal

Not that I'm aware of. This is an LDAP/AD module - maybe in a future release. On our site there is already a password reset service/policy, so we disabled password change and redirect them to the prior-existing site.

scafmac’s picture

On reviewing the post, I see you feel this is urgent. Both Kreaper and I are pretty busy and barely able to keep on top of patches. If you want to submit a patch, we'd look at it. Or if you wanted to sponsor a patch, contact me directly by clicking on my username and emailing.

fams’s picture

i posted a patch to do it
http://drupal.org/node/127935

alakad’s picture

yes, i have allready seen that patch, but is it compatible with 5.x, and how do i applied. Thanks a lot

alakad’s picture

I have tried the patch with 5.1 drupal and its doesnt work at all. I also tried the patch with the 4.7 version of drupal but when i change the password i keep getting this error. I use php5

* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/drupal/modules/ldap_integration/ldapdata.module on line 451.
* warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/drupal/modules/ldap_integration/ldapdata.module on line 455.

fams’s picture

sorry for the late
strange behaviour... send me your ldapdata.module

geste’s picture

I'm curious to know if another revision of this patch was produced or maybe merged.

My situation: I am running Drupal 5.2 with Fedora Directory Server LDAP. LDAP is also password back-end for our Samba 3 domain. We also use Webserver_auth module that trusts our university PubCookie system.

Sooooo, it would be great to have a Drupal page that would allow folks to change Unix password and Samba password simultaneously. Your patch seems like the way to do it, but I was unsure of situation/status.

Thanks,

Jim

Cantalamessa’s picture

Version: 5.x-2.x-dev » 5.x-1.3

I have a fast solution, while we wait for a working patch, which requires that DRUPAL and SMB are on the same server

In function ldapdata_user_update_drupal_account() of the ldapdata.module, put the following code

...
          if ($value) {
            $pw = $encr ? '{md5}' . base64_encode(pack('H*', md5($value))) : $value;
            $writeout[$ldap_attr] = $pw;
            // hack to modify samba account
            if (1) {
             $systemcommand = "echo -e \"".$value."\\n".$value."\\n\""." | sudo smbpasswd -a ".$user->name." -s";
             $systemresult = exec($systemcommand);
             watchdog('user', "User ".$user->name." has changed also its SAMBA password");
            }
            // end of hack
          }
...

and edit with visudo the sudoers file, adding the following line

wwwrun  hostname = (root) NOPASSWD: /usr/bin/smbpasswd

where wwwrun should be the user running the HTTP server and hostname should be the name of the host.

This "patch" script may present some security issues, thus use it only if you know what you are doing.

johnbarclay’s picture

Status: Active » Closed (won't fix)

Closing 5.x issues to clean out issue queue.

johnbarclay’s picture

Closing 5.x issues to clean out issue queue.