ClearFoundation Tracker - ClearOS
View Issue Details
0006951ClearOSapp-samba - Windows Networkingpublic2016-01-11 08:112016-08-29 09:40
bchambers 
user2 
normalmajorhave not tried
closedfixed 
7.1.0 
7.1.0 Updates 
0006951: Samba fails to initialize
Community Edition on 30 day verified repos (not sure if it makes a difference).

After some reports on the forums (https://www.clearos.com/clearfoundation/social/community/db-not-starting [^]) of issues, tried to duplicate this issue.

My Samba did not initialize...the logs indicated this command was failing:

/usr/clearos/sandbox/usr/bin/php /usr/sbin/app-samba-initialize -d CLEARSYSTEM -n MyServer -p supersecretpw

Stack trace showed:

Fatal - uncaught exception: exception 'clearos\apps\base\Engine_Exception' with message 'Command execution failed.' in /usr/clearos/apps/base/libraries/Shell.php:207
Stack trace:
#0 /usr/clearos/apps/samba/libraries/OpenLDAP_Driver.php(2382): clearos\apps\base\Shell->execute('/usr/bin/net', 'idmap secret '*...', true, Array)
0000001 /usr/clearos/apps/samba/libraries/OpenLDAP_Driver.php(591): clearos\apps\samba\OpenLDAP_Driver->_save_idmap_password()
0000002 /usr/sbin/app-samba-initialize(171): clearos\apps\samba\OpenLDAP_Driver->initialize_samba_as_master_or_standalone('MyServer', 'CLEARSYSTEM', 'supersecretpw', false)
0000003 {main}

Coming from:

/usr/bin/sudo /usr/bin/net idmap secret '*' 0XpHPLZPC0tjdL4C

Looks like either a bug or something changed in a samba upgrade...the new syntax is:

/usr/bin/sudo /usr/bin/net idmap set secret '*' 0XpHPLZPC0tjdL4C

In the samba library, function _save_idmap_password(), changing:

        $exitcode = $shell->Execute(self::COMMAND_NET, "idmap secret '*' $password", TRUE, $options);

To

        $exitcode = $shell->Execute(self::COMMAND_NET, "idmap set secret '*' $password", TRUE, $options);

And then going through the initialization stage then leads to success.



No tags attached.
Issue History
2016-01-11 08:11bchambersNew Issue
2016-01-11 17:53user2Statusnew => resolved
2016-01-11 17:53user2Fixed in Version => 7.1.0 Updates
2016-01-11 17:53user2Resolutionopen => fixed
2016-01-11 17:53user2Assigned To => user2
2016-08-29 09:40user2Statusresolved => closed

There are no notes attached to this issue.