added test-function in landaemon.pl

This commit is contained in:
katagia 2003-10-23 18:25:55 +00:00
parent d0292f2cea
commit c590e897d5
4 changed files with 30 additions and 16 deletions

View File

@ -56,7 +56,29 @@ thins to get it work.
admin-user was encrypted with {SSHA}. I had to change encryption admin-user was encrypted with {SSHA}. I had to change encryption
for admin-accounts to {CRYPT} to get ssh work. for admin-accounts to {CRYPT} to get ssh work.
5. Test lamdaemon.pl
I've installed a test-function in lamdaemon.pl. Please run lamdaemon.pl
with the following attributes to test it:
lamdaemon.pl $ssh-server $lam_path_on_host $admin-username $admin-password *test
$ssh-server is the remote host lamdaemon.pl should be run
$lam_path_on_host is the path to lamdaemon.pl on remote host
$admin-username is the name of the user which is allowed to run lamdaemon.pl
as root. It's the same user in /etc/sudoers
$admin-password is the password of admin-user
*test is the command which tells lamdaemon.pl to test settings
You have to run the coammd as the user your webserver is running as, e.g.
wwwrun@tilo:/srv/www/htdocs/lam/lib> /srv/www/htdocs/lam/lib/lamdaemon.pl \
127.0.0.1 /srv/www/htdocs/lam/lib/lamdaemon.pl root secret *test
You should get the following response:
Net::SSH::Perl successfully installed.
sudo set up correctly.
Perl quota module successfully installed.
If you have'nt seen any error lamdaemon.pl should set up successfully.
Now everything should work fine Now everything should work fine
This is a very incomplete Documention for Alpha-Release only. This is a very incomplete Documention for Beta-Release only.
Pleas send a mail to TiloLutz@gmx.de if you have any suggsestion Pleas send a mail to TiloLutz@gmx.de if you have any suggsestion

View File

@ -1669,8 +1669,6 @@ function createhost($values) {
$attr['gecos'] = utf8_encode(replace_umlaut($values->general_gecos)); $attr['gecos'] = utf8_encode(replace_umlaut($values->general_gecos));
$attr['description'] = utf8_encode($values->general_gecos); $attr['description'] = utf8_encode($values->general_gecos);
// Set unix password // Set unix password
$attr['userPassword'] = pwd_hash('');
$attr['shadowLastChange'] = getdays();
// Samba attributes // Samba attributes
if ($_SESSION['config']->is_samba3()) { if ($_SESSION['config']->is_samba3()) {
@ -1771,12 +1769,6 @@ function modifyhost($values,$values_old) {
if ($values->smb_displayName != $values_old->smb_displayName) if ($values->smb_displayName != $values_old->smb_displayName)
$attr['displayName'] = utf8_encode($values->smb_displayName); $attr['displayName'] = utf8_encode($values->smb_displayName);
// Set unix password
if ($values->smb_password_no) {
$attr['userPassword'] = pwd_hash('');
$attr['shadowLastChange'] = getdays(); // shadowAccount_may
}
// Samba attributes // Samba attributes
if ($_SESSION['config']->is_samba3()) { if ($_SESSION['config']->is_samba3()) {
if (!in_array('sambaSamAccount', $values->general_objectClass)) { if (!in_array('sambaSamAccount', $values->general_objectClass)) {
@ -1837,8 +1829,6 @@ function modifyhost($values,$values_old) {
$attr['sambaNTPassword'] = '0CB6948805F797BF2A82807973B89537'; $attr['sambaNTPassword'] = '0CB6948805F797BF2A82807973B89537';
$attr['sambaLMPassword'] = '01FC5A6BE7BC6929AAD3B435B51404EE'; $attr['sambaLMPassword'] = '01FC5A6BE7BC6929AAD3B435B51404EE';
$attr['sambaPwdLastSet'] = time(); // sambaAccount_may $attr['sambaPwdLastSet'] = time(); // sambaAccount_may
$attr['userPassword'] = '';
$attr['shadowLastChange'] = getdays();
} }
if ($values->smb_domain->name!=$values_old->smb_domain->name) $attr['sambaDomainName'] = $values->smb_domain->name; // sambaAccount_may if ($values->smb_domain->name!=$values_old->smb_domain->name) $attr['sambaDomainName'] = $values->smb_domain->name; // sambaAccount_may
} }
@ -1901,8 +1891,6 @@ function modifyhost($values,$values_old) {
$attr['ntPassword'] = '0CB6948805F797BF2A82807973B89537'; $attr['ntPassword'] = '0CB6948805F797BF2A82807973B89537';
$attr['lmPassword'] = '01FC5A6BE7BC6929AAD3B435B51404EE'; $attr['lmPassword'] = '01FC5A6BE7BC6929AAD3B435B51404EE';
$attr['pwdLastSet'] = time(); // sambaAccount_may $attr['pwdLastSet'] = time(); // sambaAccount_may
$attr['userPassword'] = '';
$attr['shadowLastChange'] = getdays();
} }
if (isset($attr_old['sambaSID'][0])) $attr_rem['sambaSID'] = $attr_old['sambaSID'][0]; if (isset($attr_old['sambaSID'][0])) $attr_rem['sambaSID'] = $attr_old['sambaSID'][0];
if (($values->smb_domain!='') && ($values->smb_domain!=$values_old->smb_domain)) $attr['domain'] = $values->smb_domain; // sambaAccount_may if (($values->smb_domain!='') && ($values->smb_domain!=$values_old->smb_domain)) $attr['domain'] = $values->smb_domain; // sambaAccount_may

View File

@ -24,7 +24,6 @@
$debug=true; # Show debug messages $debug=true; # Show debug messages
use Quota; # Needed to get and set quotas
#use strict; # Use strict for security reasons #use strict; # Use strict for security reasons
@quota_grp; @quota_grp;
@ -69,6 +68,9 @@ sub get_fs { # Load mountpoints from mtab if enabled quotas
# ***************** Check values # ***************** Check values
if ($( == 0 ) { if ($( == 0 ) {
if ($ARGV[2] eq "*test") { print "sudo set up correctly.\n"; }
use Quota; # Needed to get and set quotas
if ($ARGV[2] eq "*test") { print "Perl quota module successfully installed.\n"; }
# Drop root Previleges # Drop root Previleges
($<, $>) = ($>, $<); ($<, $>) = ($>, $<);
switch: { switch: {
@ -175,12 +177,14 @@ if ($( == 0 ) {
}; };
last switch; last switch;
}; };
print "$return\n"; if ($ARGV[2] eq "*test") { print "If you have'nt seen any error lamdaemon.pl should set up successfully.\n"; }
else { print "$return\n"; }
} }
else { else {
$hostname = shift @ARGV; $hostname = shift @ARGV;
$remotepath = shift @ARGV; $remotepath = shift @ARGV;
use Net::SSH::Perl; use Net::SSH::Perl;
if ($ARGV[2] eq "*test") { print "Net::SSH::Perl successfully installed.\n"; }
@username = split (',', $ARGV[0]); @username = split (',', $ARGV[0]);
$username[0] =~ s/uid=//; $username[0] =~ s/uid=//;
my $ssh = Net::SSH::Perl->new($hostname, options=>[ my $ssh = Net::SSH::Perl->new($hostname, options=>[

View File

@ -423,7 +423,7 @@ switch ($select_local) {
echo _("Save profile"); echo _("Save profile");
echo "</b></legend>\n<table border=0 width=\"100%\">\n<tr>\n<td width=\"50%\">"; echo "</b></legend>\n<table border=0 width=\"100%\">\n<tr>\n<td width=\"50%\">";
echo '<input name="f_finish_safeProfile" type="text" size="30" maxlength="50">'; echo '<input name="f_finish_safeProfile" type="text" size="30" maxlength="50">';
echo '</td><td width=\"30%\"><input name="save" type="submit" value="'; echo '</td><td width="30%"><input name="save" type="submit" value="';
echo _('Save profile'); echo _('Save profile');
echo '"></td><td width="20%"><a href="../help.php?HelpNumber=457" target="lamhelp">'._('Help'); echo '"></td><td width="20%"><a href="../help.php?HelpNumber=457" target="lamhelp">'._('Help');
echo "</a></td>\n</tr>\n</table>\n</fieldset>"; echo "</a></td>\n</tr>\n</table>\n</fieldset>";